Comment on [help] How to decide what to do with command line parameters?
TehPers@beehaw.org 1 year ago
Others have already mentioned argparse
, which is a pretty great module for argument parsing if you want to use something built-in. If you’re willing to look into other libraries though, I’d recommend taking a look at Click. You should be able to pip install click
to use it. It takes advantage of defining the CLI through decorators, and from my experience, works better when you want to have subcommands.
bloopernova@programming.dev 1 year ago
Interesting! I’ll check it out.
I’ve replaced the Traitlets based arg parsing with argparse, and the subcommands are working ok so far. I’ll see if Click can add anything, thank you for the recommendation!