-
-
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
Clarify documentation regarding AppSettings and child subcommand propagation #429
Comments
Thank you for example. I am not sure, but I think negative arguments should be passed in quotes. Let's wait for the @kbknapp answer. |
I tried with quotes, still no go. |
You have to use the I'll leave this open until you can confirm that's working for you. 😉 |
Basically tried with that: let matches = App::new("doppler")
.setting(AppSettings::AllowLeadingHyphen)
.version(env!("CARGO_PKG_VERSION"))
.about("Compensates IQ data stream doppler shift based on TLE information, also can be used for doing constant baseband shifting")
.subcommand(SubCommand::with_name("const")
.about("Constant shift mode")
.arg(Arg::with_name("SHIFT")
.long("shift")
.help("frequency shift in Hz")
.required(true)
.takes_value(true)))
.get_matches(); And still got:
|
You should specify setting for subcommand, because it is also an let matches = App::new("doppler")
.version(env!("CARGO_PKG_VERSION"))
.about("Compensates IQ data stream doppler shift based on TLE information, also can be used for doing constant baseband shifting")
.subcommand(SubCommand::with_name("const")
.about("Constant shift mode")
.setting(AppSettings::AllowLeadingHyphen)
.arg(Arg::with_name("SHIFT")
.long("shift")
.help("frequency shift in Hz")
.required(true)
.takes_value(true)))
.get_matches(); |
Ah ok, that's because the Edit: Oops @Vinatorul beat me to it! 😉 |
Very good now it works. I guess I can close it. |
@andresv thank you for response. I think it will be reclassified as documentation issue. |
Issue 421, 427, and 429 This PR adds better examples for `Arg` methods as well as * implements support for displaying the help on the next line (#427) * Clarifies `AppSettings` propagation rules (#429) * Fixes failing clippy lints * Moves github specific files to a `.github` directory ---- Copied from #421 - [x] `short` - [x] `long` - [x] `help` - [x] `required` - [x] `conflicts_with` - [x] `conflicts_with_all` - [x] `overrides_with` - [x] `overrides_with_all` - [x] `requires` - [x] `requires_all` - [x] `takes_value` - [x] `index` - [x] `multiple` - [x] `global` - [x] `empty_values` - [x] `hidden` - [x] `possible_values` - [x] `possible_value` - [x] `group` - [x] `number_of_values` - [x] `validator` - [x] `max_values` - [x] `min_values` - [x] `use_delimiter` - [x] `value_delimiter` - [x] `value_names` - [x] `value_name` - [x] `default_value` - [x] `next_line_help`
Issue 421, 427, and 429 This PR adds better examples for `Arg` methods as well as * implements support for displaying the help on the next line (#427) * Clarifies `AppSettings` propagation rules (#429) * Fixes failing clippy lints * Moves github specific files to a `.github` directory ---- Copied from #421 - [x] `short` - [x] `long` - [x] `help` - [x] `required` - [x] `conflicts_with` - [x] `conflicts_with_all` - [x] `overrides_with` - [x] `overrides_with_all` - [x] `requires` - [x] `requires_all` - [x] `takes_value` - [x] `index` - [x] `multiple` - [x] `global` - [x] `empty_values` - [x] `hidden` - [x] `possible_values` - [x] `possible_value` - [x] `group` - [x] `number_of_values` - [x] `validator` - [x] `max_values` - [x] `min_values` - [x] `use_delimiter` - [x] `value_delimiter` - [x] `value_names` - [x] `value_name` - [x] `default_value` - [x] `next_line_help`
Issue 421, 427, and 429 This PR adds better examples for `Arg` methods as well as * implements support for displaying the help on the next line (#427) * Clarifies `AppSettings` propagation rules (#429) * Fixes failing clippy lints * Moves github specific files to a `.github` directory ---- Copied from #421 - [x] `short` - [x] `long` - [x] `help` - [x] `required` - [x] `conflicts_with` - [x] `conflicts_with_all` - [x] `overrides_with` - [x] `overrides_with_all` - [x] `requires` - [x] `requires_all` - [x] `takes_value` - [x] `index` - [x] `multiple` - [x] `global` - [x] `empty_values` - [x] `hidden` - [x] `possible_values` - [x] `possible_value` - [x] `group` - [x] `number_of_values` - [x] `validator` - [x] `max_values` - [x] `min_values` - [x] `use_delimiter` - [x] `value_delimiter` - [x] `value_names` - [x] `value_name` - [x] `default_value` - [x] `next_line_help`
Clap 2.1.0
Example code is here (i have not yet pushed minor tweaks needed for clap 2.x, but overall concept is the same): https://github.com/cubehub/doppler/blob/master/src/usage.rs#L153.
If negative number like
-6400
is given to--shift
, i get this:The text was updated successfully, but these errors were encountered: