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.

Is it possible to add a feature for dynamically grouping options, like:

Naval Fate.

Usage:
  naval_fate.py ship new <name>...
  naval_fate.py ship <name> move <x> <y> [ship_options]
  naval_fate.py ship shoot <x> <y>
  naval_fate.py mine (set|remove) <x> <y> [mine_options]
  naval_fate.py [options]

Options:
  -h --help     Show this screen.
  --version     Show version.

Mine Options:
  --moored      Moored (anchored) mine.
  --drifting    Drifting mine.

Ship Options:
  --speed=<kn>  Speed in knots [default: 10].

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:4
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
feluxecommented, Nov 27, 2016

Docopt syntax is based on POSIX, and we allow extensions only if their syntax is widely used. Do you have any alternatives to [-ship_options-] syntax that are more widely recognized? You are trying to solve this particular problem, that other CLI likely encountered before. How did they solve it? What syntax did they use?

@frnhr @keleshev

I don’t understand why we need an additional syntax for it. It works for options:

Usage:
naval_fate.py [options]

Options:
  -h --help     Show this screen.
  --version     Show version.

Just let it work for more_options the same way:

Usage:
naval_fate.py one [options]
naval_fate.py two [more_options]

Options:
    -h --help     Show this screen.
    --version     Show version.

More_options:
    -f, --foo     Foo

?

0reactions
SeeSpotRuncommented, Jun 12, 2021

@conqp probably quicker if you close it yourself…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Options Group > Options Group Home
See why Options Group is the premier global recruiting firm for financial services with executive search talent planning, acquisition and retention.
Read more >
<optgroup>: The Option Group element - MDN Web Docs
The <optgroup> HTML element creates a grouping of options within a <select> element. Try it. HTML Demo: <optgroup>. Reset. HTML CSS
Read more >
HTML optgroup tag - W3Schools
The <optgroup> tag is used to group related options in a <select> element (drop-down list). If you have a long list of options,...
Read more >
Create a group & choose group settings - Google Groups Help
Create a group & choose group settings · Find people with similar hobbies or interests and take part in online conversations. · Email...
Read more >
Group Options
Group Options contains a number of additional options available for groups and blocks. When importing rooming lists, select the Rooming List button 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