Jaymon / captain

command line python scripts for humans
MIT License
13 stars 1 forks source link

Subcommand aliases #61

Closed Jaymon closed 4 years ago

Jaymon commented 4 years ago

So I currently set the aliases in the parsers, this works but creates annoying help messages, but I have access to the args, so I can create a separate alias dict and then check it in Captain.run() and switch out the given alias for the real one in argv.

Actually, I could even do it in parser.parse_handle_args(argv) where it will check argv[0] and switch it out for an alias before passing argv to the parser, that way the help messages can stay easy to follow but still allow all the aliases to be supported.