Jaymon / captain

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

captain subparsers #46

Closed Jaymon closed 4 years ago

Jaymon commented 6 years ago

is this needed?

subparsers.required = True # https://bugs.python.org/issue9253#msg186387

I added it in bounce and just added it to the new cli stuff in pout, but it doesn't look like captain has it when it does subcommands.

I think the flow should be, if you have a main command, then subparsers.required should be set to False because if you didn't include a subcommand main() would be run, but if there is no main then subparsers.required should be set to True because it would be required

Jaymon commented 6 years ago

the current state of the art on how I want subparsers and help to be displayed is in pout's __main__.py file, it prints a description and help for --help both before and after the subcommand and prints an ok abbreviated error message when no subcommand is given