You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An improvement to the use experience would be to add both separate cli script under a single parser. I have done such a think in my own project as well and it's very easy to implement by using pythons ArgumentParser class and its ability to create sub parser objects:
importargparsemain_parser=argparse.ArgumentParser(prog="olga", description="")
# Add some options to the main parser here.# Like options that can be used for all underlying programs (like model type or# separator).subparsers=main_parser.add_subparsers(help="", dest="subparser_name")
# Add a sub parser to the main parser here.# Example:subparsers.add_parser("GenerateSeqs", help="", description="")
# Add some options to the 'GenerateSeqs' sub parser here.# Options only used for this specific parser.# Parse the command line arguments. The sub parser name specifies which option# to execute.parsed_arguments=main_parser.parse_args()
ifparsed_arguments.subparser_name=="GenerateSeqs":
# Generate some sequences# Note that the 'parsed_arguments' object only contains option arguments based# on the given 'subparser_name' destination. This removes a lot of clutter.
Hope this helps!
Cheers, Wout
The text was updated successfully, but these errors were encountered:
An improvement to the use experience would be to add both separate cli script under a single parser. I have done such a think in my own project as well and it's very easy to implement by using pythons
ArgumentParser
class and its ability to create sub parser objects:Hope this helps!
Cheers, Wout
The text was updated successfully, but these errors were encountered: