question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

argument groups enhancement

See original GitHub issue

In 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:open
  • Created 10 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
keleshevcommented, Apr 29, 2013

There is no convention behind this, so (I think) this will be more confusing than useful.

1reaction
jriccommented, May 3, 2013

If you guys agree to incorporate it, I can probably implement it.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found