mirror of
https://github.com/clap-rs/clap
synced 2025-03-04 23:37:32 +00:00
parent
5911b64255
commit
8fc12586bb
5 changed files with 14 additions and 6 deletions
|
@ -113,6 +113,8 @@ impl_settings! { AppSettings, AppFlags,
|
|||
=> Flags::PROPAGATE_VERSION,
|
||||
GlobalVersion("propagateversion")
|
||||
=> Flags::PROPAGATE_VERSION,
|
||||
HidePossibleValues("hidepossiblevalues")
|
||||
=> Flags::NO_POS_VALUES,
|
||||
HidePossibleValuesInHelp("hidepossiblevaluesinhelp")
|
||||
=> Flags::NO_POS_VALUES,
|
||||
HelpExpected("helpexpected")
|
||||
|
@ -786,6 +788,12 @@ pub enum AppSettings {
|
|||
///
|
||||
/// To set this per argument, see
|
||||
/// [`Arg::hide_possible_values`][crate::Arg::hide_possible_values].
|
||||
HidePossibleValues,
|
||||
/// Deprecated, replaced with [`AppSettings::HidePossibleValues`]
|
||||
#[deprecated(
|
||||
since = "3.0.0",
|
||||
note = "Replaced with AppSettings::HidePossibleValues"
|
||||
)]
|
||||
HidePossibleValuesInHelp,
|
||||
|
||||
/// Panic if help descriptions are omitted.
|
||||
|
@ -1195,8 +1203,8 @@ mod test {
|
|||
AppSettings::Hidden
|
||||
);
|
||||
assert_eq!(
|
||||
"hidepossiblevaluesinhelp".parse::<AppSettings>().unwrap(),
|
||||
AppSettings::HidePossibleValuesInHelp
|
||||
"hidepossiblevalues".parse::<AppSettings>().unwrap(),
|
||||
AppSettings::HidePossibleValues
|
||||
);
|
||||
assert_eq!(
|
||||
"helpexpected".parse::<AppSettings>().unwrap(),
|
||||
|
|
|
@ -3889,7 +3889,7 @@ impl<'help> Arg<'help> {
|
|||
/// **NOTE:** Setting this requires [`Arg::takes_value`]
|
||||
///
|
||||
/// To set this for all arguments, see
|
||||
/// [`AppSettings::HidePossibleValuesInHelp`][crate::AppSettings::HidePossibleValuesInHelp].
|
||||
/// [`AppSettings::HidePossibleValues`][crate::AppSettings::HidePossibleValues].
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
|
|
@ -82,7 +82,7 @@ impl<'help, 'app, 'parser, 'writer> Help<'help, 'app, 'parser, 'writer> {
|
|||
),
|
||||
};
|
||||
let next_line_help = parser.is_set(AppSettings::NextLineHelp);
|
||||
let hide_pv = parser.is_set(AppSettings::HidePossibleValuesInHelp);
|
||||
let hide_pv = parser.is_set(AppSettings::HidePossibleValues);
|
||||
|
||||
Help {
|
||||
writer,
|
||||
|
|
|
@ -428,7 +428,7 @@ fn skip_possible_values() {
|
|||
.author("Kevin K.")
|
||||
.about("tests stuff")
|
||||
.version("1.3")
|
||||
.setting(AppSettings::HidePossibleValuesInHelp)
|
||||
.setting(AppSettings::HidePossibleValues)
|
||||
.args(&[
|
||||
arg!(-o --opt <opt> "some option")
|
||||
.required(false)
|
||||
|
|
|
@ -1168,7 +1168,7 @@ fn issue_688_hidden_pos_vals() {
|
|||
let app1 = App::new("ctest")
|
||||
.version("0.1")
|
||||
.term_width(120)
|
||||
.setting(AppSettings::HidePossibleValuesInHelp)
|
||||
.setting(AppSettings::HidePossibleValues)
|
||||
.arg(Arg::new("filter")
|
||||
.help("Sets the filter, or sampling method, to use for interpolation when resizing the particle \
|
||||
images. The default is Linear (Bilinear). [possible values: Nearest, Linear, Cubic, Gaussian, Lanczos3]")
|
||||
|
|
Loading…
Add table
Reference in a new issue