argument groups enhancement
See original GitHub issueIn the spirit of DRY (not repeating myself), I would like support for argument groups that can apply to one or more subcommands. In addition, a “Global Options” group that applies to every subcommand. Example:
Naval Fate.
Usage:
naval_fate.py ship new <name>...
naval_fate.py ship <name> move [Location] [<ean>...]
naval_fate.py ship shoot [Location]
naval_fate.py mine (set|remove) [Location] [--moored|--drifting]
naval_fate.py -h | --help
naval_fate.py --version
Location: <x> <y> [--sector=<sector_num>]
<x> x-coordinate on map
<y> y-coordinate on map
--sector=<sector_num> Which map sector? [default: active]
Global Options:
--verbose How verbose should we be? [default: 0] [max: 3]
-o --output=(console|email) Send result to your console, or your inbox? [default: console]
Other Options:
-h --help Show this screen.
--version Show version.
--speed=<kn> Speed in knots [default: 10].
--moored Moored (anchored) mine.
--drifting Drifting mine.
Issue Analytics
- State:
- Created 10 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Group polarization - Wikipedia
In social psychology, group polarization refers to the tendency for a group to make decisions that are more extreme than the initial inclination...
Read more >Does argparse (python) support mutually exclusive groups of ...
bugs.python.org/issue10984 has a patch that lets you put an argument into more than one mutually exclusive group. Doing that is an easy change....
Read more >Working with parameter groups - AWS Documentation
A DB parameter group acts as a container for engine configuration values that are applied to one or more DB instances. DB cluster...
Read more >SLEP009: Keyword-only arguments
This proposal discusses the path to gradually forcing users to pass arguments, or most of them, as keyword arguments only.
Read more >Improving analytical reasoning and argument understanding
Seminar students understood the arguments better, and their essays ... do not enhance student comprehension, then we expect both groups to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There is no convention behind this, so (I think) this will be more confusing than useful.
If you guys agree to incorporate it, I can probably implement it.