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

V3 dev #1177

Merged
merged 3 commits into from
Feb 12, 2018
Merged

V3 dev #1177

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,14 +540,14 @@ impl<'w> Help<'w> {
debugln!("Help::spec_vals: Found possible vals...{:?}", pv);
spec_vals.push(if self.color {
format!(
" [values: {}]",
" [possible values: {}]",
pv.iter()
.map(|v| format!("{}", self.cizer.good(v)))
.collect::<Vec<_>>()
.join(", ")
)
} else {
format!(" [values: {}]", pv.join(", "))
format!(" [possible values: {}]", pv.join(", "))
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ impl Error {
Error {
message: format!(
"{} '{}' isn't a valid value for '{}'\n\t\
[values: {}]\n\
[possible values: {}]\n\
{}\n\n\
{}\n\n\
For more information try {}",
Expand Down
18 changes: 9 additions & 9 deletions tests/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ FLAGS:
-V, --version Prints version information

OPTIONS:
-O, --Option <option3> specific vals [values: fast, slow]
-O, --Option <option3> specific vals [possible values: fast, slow]
--long-option-2 <option2> tests long options with exclusions
--maxvals3 <maxvals>... Tests 3 max vals
--minvals2 <minvals>... Tests 2 min vals
Expand All @@ -45,7 +45,7 @@ OPTIONS:
ARGS:
<positional> tests positionals
<positional2> tests positionals with exclusions
<positional3>... tests specific values [values: vi, emacs]
<positional3>... tests specific values [possible values: vi, emacs]

SUBCOMMANDS:
help Prints this message or the help of the given subcommand(s)
Expand Down Expand Up @@ -244,7 +244,7 @@ FLAGS:

OPTIONS:
-c, --cafe <FILE> A coffeehouse, coffee shop, or café.
-p, --pos <VAL> Some vals [values: fast, slow]";
-p, --pos <VAL> Some vals [possible values: fast, slow]";

static FINAL_WORD_WRAPPING: &'static str = "ctest 0.1

Expand Down Expand Up @@ -299,8 +299,8 @@ FLAGS:

OPTIONS:
--filter <filter> Sets the filter, or sampling method, to use for interpolation when resizing the particle
images. The default is Linear (Bilinear). [values: Nearest, Linear, Cubic, Gaussian,
Lanczos3]";
images. The default is Linear (Bilinear). [possible values: Nearest, Linear, Cubic,
Gaussian, Lanczos3]";

static ISSUE_702: &'static str = "myapp 1.0
foo
Expand Down Expand Up @@ -501,7 +501,7 @@ FLAGS:

OPTIONS:
-c, --cafe <FILE> A coffeehouse, coffee shop, or café. [env: ENVVAR]
-p, --pos <VAL> Some vals [values: fast, slow]";
-p, --pos <VAL> Some vals [possible values: fast, slow]";

static SHOW_ENV_VALS: &'static str = "ctest 0.1

Expand All @@ -514,7 +514,7 @@ FLAGS:

OPTIONS:
-c, --cafe <FILE> A coffeehouse, coffee shop, or café. [env: ENVVAR=MYVAL]
-p, --pos <VAL> Some vals [values: fast, slow]";
-p, --pos <VAL> Some vals [possible values: fast, slow]";

fn setup() -> App<'static, 'static> {
App::new("test")
Expand Down Expand Up @@ -877,7 +877,7 @@ fn issue_688_hidden_pos_vals() {
.setting(AppSettings::HidePossibleValuesInHelp)
.arg(Arg::with_name("filter")
.help("Sets the filter, or sampling method, to use for interpolation when resizing the particle \
images. The default is Linear (Bilinear). [values: Nearest, Linear, Cubic, Gaussian, Lanczos3]")
images. The default is Linear (Bilinear). [possible values: Nearest, Linear, Cubic, Gaussian, Lanczos3]")
.long("filter")
.possible_values(&filter_values)
.takes_value(true));
Expand All @@ -899,7 +899,7 @@ fn issue_688_hidden_pos_vals() {
.set_term_width(120)
.arg(Arg::with_name("filter")
.help("Sets the filter, or sampling method, to use for interpolation when resizing the particle \
images. The default is Linear (Bilinear). [values: Nearest, Linear, Cubic, Gaussian, Lanczos3]")
images. The default is Linear (Bilinear). [possible values: Nearest, Linear, Cubic, Gaussian, Lanczos3]")
.long("filter")
.takes_value(true));
assert!(test::compare_output(app3, "ctest --help", ISSUE_688, false));
Expand Down
4 changes: 2 additions & 2 deletions tests/possible_values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use clap::{App, Arg, ErrorKind};

#[cfg(feature = "suggestions")]
static PV_ERROR: &'static str = "error: 'slo' isn't a valid value for '--Option <option3>'
\t[values: fast, slow]
\t[possible values: fast, slow]

\tDid you mean 'slow'?

Expand All @@ -21,7 +21,7 @@ For more information try --help";

#[cfg(not(feature = "suggestions"))]
static PV_ERROR: &'static str = "error: 'slo' isn't a valid value for '--Option <option3>'
\t[values: fast, slow]
\t[possible values: fast, slow]


USAGE:
Expand Down