Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Associate option values with specific arguments #94

Open
nim-nim opened this issue Apr 3, 2019 · 0 comments
Open

Associate option values with specific arguments #94

nim-nim opened this issue Apr 3, 2019 · 0 comments

Comments

@nim-nim
Copy link

nim-nim commented Apr 3, 2019

I have a (complex) set of options used to define the properties of an argument (some properties are optional, others mandatory, it's not a simple set).

I now need to write a subcommand that manipulates sets of this argument. Unfortunately, all the arguments in the set do not necessarily share the same properties.

The natural user-friendly way to do it would be to rely on

Order between options and arguments is significant

and basically do something like

[  [-a|--along=<avalue>]  |  [-b|--blong=<bvalue>] ] ARG...]... ]

Which basically means that:

  • each ARG takes the option values specified before it on the CLI
  • ARGs without options take the same options as the first preceding ARG with options
  • ARGS with no option at all should appear first (or I should define a specific nooption option)

mow.cli would then generate lists of structs for ARGS, with the ARG value as main field, and all the usual option lists as other fields

Short term I will pretend all the arguments share the same properties, but I'm pretty sure that a user will remind me this design is broken in the next months

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant