mirror of
https://github.com/clap-rs/clap
synced 2024-11-14 00:27:13 +00:00
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:
parent
b190a6a817
commit
181eff5541
3 changed files with 7 additions and 6 deletions
1
Makefile
1
Makefile
|
@ -26,3 +26,4 @@ build-%:
|
||||||
|
|
||||||
test-%:
|
test-%:
|
||||||
cargo test ${_FEATURES_${@:test-%=%}} --all-targets ${ARGS}
|
cargo test ${_FEATURES_${@:test-%=%}} --all-targets ${ARGS}
|
||||||
|
cargo test ${_FEATURES_${@:test-%=%}} --doc ${ARGS}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
//! fn build_cli() -> App<'static> {
|
//! fn build_cli() -> App<'static> {
|
||||||
//! App::new("example")
|
//! App::new("example")
|
||||||
//! .arg(Arg::new("file")
|
//! .arg(Arg::new("file")
|
||||||
//! .about("some input file")
|
//! .help("some input file")
|
||||||
//! .value_hint(ValueHint::AnyPath),
|
//! .value_hint(ValueHint::AnyPath),
|
||||||
//! )
|
//! )
|
||||||
//! .arg(
|
//! .arg(
|
||||||
|
@ -104,13 +104,13 @@ pub use shell::Shell;
|
||||||
/// App::new("compl")
|
/// App::new("compl")
|
||||||
/// .about("Tests completions")
|
/// .about("Tests completions")
|
||||||
/// .arg(Arg::new("file")
|
/// .arg(Arg::new("file")
|
||||||
/// .about("some input file"))
|
/// .help("some input file"))
|
||||||
/// .subcommand(App::new("test")
|
/// .subcommand(App::new("test")
|
||||||
/// .about("tests things")
|
/// .about("tests things")
|
||||||
/// .arg(Arg::new("case")
|
/// .arg(Arg::new("case")
|
||||||
/// .long("case")
|
/// .long("case")
|
||||||
/// .takes_value(true)
|
/// .takes_value(true)
|
||||||
/// .about("the case to test")))
|
/// .help("the case to test")))
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
|
|
@ -2036,7 +2036,7 @@ impl<'help> Arg<'help> {
|
||||||
/// // value with a help text
|
/// // value with a help text
|
||||||
/// PossibleValue::new("slow").help("not that fast"),
|
/// PossibleValue::new("slow").help("not that fast"),
|
||||||
/// // value that is hidden from completion and help text
|
/// // 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
|
/// // value with a help text
|
||||||
/// .possible_value(PossibleValue::new("slow").help("not that fast"))
|
/// .possible_value(PossibleValue::new("slow").help("not that fast"))
|
||||||
/// // value that is hidden from completion and help text
|
/// // 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")
|
/// let m = App::new("prog")
|
||||||
/// .arg(Arg::new("cfg")
|
/// .arg(Arg::new("cfg")
|
||||||
/// .long("config")
|
/// .long("config")
|
||||||
/// .hidden(true)
|
/// .hide(true)
|
||||||
/// .help("Some help text describing the --config arg"))
|
/// .help("Some help text describing the --config arg"))
|
||||||
/// .get_matches_from(vec![
|
/// .get_matches_from(vec![
|
||||||
/// "prog", "--help"
|
/// "prog", "--help"
|
||||||
|
|
Loading…
Reference in a new issue