Last active
June 21, 2023 05:22
-
-
Save Groostav/0968a3c32f5d9a1a0eb121c9133653bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parser = argparse.ArgumentParser() | |
parser.addArgument('--print-metadata') | |
subparsers = parser.add_subparsers(dest='command') | |
subparsers.add_parser(name='build') | |
subparsers.add_parser(name='predict') | |
parsed_args = parser.parse_args() | |
match vars(parsed_args): | |
case { "command": "build" }: | |
raise 'implement build!' | |
case { "command": "predict" }: | |
raise 'implement predict!' | |
case { "print_metadata": blob_path }: | |
raise 'implement --print-metadata for path '+blob_path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parsed_args = above() # argparse config as above... | |
match parsed_args: | |
case { .command == "build" }: | |
raise 'implement build!' | |
case { .command == "predict" }: | |
raise 'implement predict!' | |
case { blob_path = .print_metadata }: | |
raise 'implement --print-metadata for path '+blob_path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment