-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Possibly incorrect generated usage grammar #89
Comments
* `--version` now includes the API revision we embody (using crate_version()) * Allow multiple scopes to be specified, instead of just one. Previously this was problemantic due to argument parsing of docopt being greedy. However, this also means we have to specify the `-r` flag for each invocation. See clap-rs/clap#89 . * Adapted to new signature of `Arg::possible_values()` and used the previously orphaned `UploadProtocol` enum. * Deduplicated code a little by adding the new `opt_values()` generator function. Related to #81
Yeah, I think this is kind of related to #88. The way I plan on addressing this issue is to allow Then more specifically for #88, I'm working on a say similiar to how to how you stated |
Even better ! I am looking forward to trying it. Once that feature is implemented, along with better 'requires' error messages, the command-line parsing capabilities of all 78 google service CLIs have officially arrived. |
This should be good with #91 You'll now be able to use the shorthand The one other thing this PR includes is a |
When specifying an argument like this:
The auto-generated grammar shows up like this
--scope <url>...
:This grammar was used similarly by
docopt
, but meant you could call it likeprogram --scope url1 url2
. However, withclap
it only works if the flag is repeated:program --scope url1 --scope url2
which should be resulting in a different grammar, more along the lines of[--scope <url>]...
.I believe this inconsistency should be reviewed, either docopt has an issue there, or clap :).
Side note
In any case, it would be great if the expected number of arguments could be
+
(one or more) as I also have the case where I specify-r <value>...
, which previously allowed me to make calls like-r v1 v2 v3 v4
, which is very convenient. Withclap
, I will now have to write-r v1 -r v2 -r v3 -r v4
, resulting in much more noise.This one might be related to #88, which requests a fixed amount of arguments. When thinking about python's
argparse
module, I remember that they have the notion ofnum_args
, which is either+
,*
or an explicit number. Implementing it this way would probably be a breaking change astakes_value(true|false)
would be more liketakes_value(Values::ZeroOrMore|Values::OneOrMore|Values::Exactly(5)|Values::None)
.The text was updated successfully, but these errors were encountered: