docs: Fix stale examples

These were broken in #17 and #38 when renaming `hidden` to `hide`.  These
weren't caught because we test with `--all-targets` which is mutually
exclusive with `--doc`.
This commit is contained in:
Ed Page 2021-11-30 09:49:21 -06:00
parent b190a6a817
commit 181eff5541
3 changed files with 7 additions and 6 deletions

View file

@ -26,3 +26,4 @@ build-%:
test-%:
cargo test ${_FEATURES_${@:test-%=%}} --all-targets ${ARGS}
cargo test ${_FEATURES_${@:test-%=%}} --doc ${ARGS}

View file

@ -30,7 +30,7 @@
//! fn build_cli() -> App<'static> {
//! App::new("example")
//! .arg(Arg::new("file")
//! .about("some input file")
//! .help("some input file")
//! .value_hint(ValueHint::AnyPath),
//! )
//! .arg(
@ -104,13 +104,13 @@ pub use shell::Shell;
/// App::new("compl")
/// .about("Tests completions")
/// .arg(Arg::new("file")
/// .about("some input file"))
/// .help("some input file"))
/// .subcommand(App::new("test")
/// .about("tests things")
/// .arg(Arg::new("case")
/// .long("case")
/// .takes_value(true)
/// .about("the case to test")))
/// .help("the case to test")))
/// }
/// ```
///

View file

@ -2036,7 +2036,7 @@ impl<'help> Arg<'help> {
/// // value with a help text
/// PossibleValue::new("slow").help("not that fast"),
/// // value that is hidden from completion and help text
/// PossibleValue::new("medium").hidden(true),
/// PossibleValue::new("medium").hide(true),
/// ])
/// # ;
/// ```
@ -2113,7 +2113,7 @@ impl<'help> Arg<'help> {
/// // value with a help text
/// .possible_value(PossibleValue::new("slow").help("not that fast"))
/// // value that is hidden from completion and help text
/// .possible_value(PossibleValue::new("medium").hidden(true))
/// .possible_value(PossibleValue::new("medium").hide(true))
/// # ;
/// ```
///
@ -3956,7 +3956,7 @@ impl<'help> Arg<'help> {
/// let m = App::new("prog")
/// .arg(Arg::new("cfg")
/// .long("config")
/// .hidden(true)
/// .hide(true)
/// .help("Some help text describing the --config arg"))
/// .get_matches_from(vec![
/// "prog", "--help"