Skip to content

Commit

Permalink
test(complete): Move globals down a level
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Dec 24, 2024
1 parent cff27db commit 5e6095f
Show file tree
Hide file tree
Showing 9 changed files with 700 additions and 210 deletions.
31 changes: 17 additions & 14 deletions clap_complete/examples/exhaustive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,24 @@ fn print_completions<G: Generator>(gen: G, cmd: &mut clap::Command) {
#[allow(clippy::let_and_return)]
fn cli() -> clap::Command {
clap::Command::new("exhaustive")
.version("3.0")
.propagate_version(true)
.args([
clap::Arg::new("global")
.long("global")
.global(true)
.action(clap::ArgAction::SetTrue)
.help("everywhere"),
clap::Arg::new("generate")
.long("generate")
.value_name("SHELL")
.value_parser(clap::value_parser!(Shell))
.help("generate"),
])
.args([clap::Arg::new("generate")
.long("generate")
.value_name("SHELL")
.value_parser(clap::value_parser!(Shell))
.help("generate")])
.subcommands([
clap::Command::new("global")
.version("3.0")
.propagate_version(true)
.args([clap::Arg::new("global")
.long("global")
.global(true)
.action(clap::ArgAction::SetTrue)
.help("everywhere")])
.subcommands([
clap::Command::new("one").subcommand(clap::Command::new("one-one")),
clap::Command::new("two"),
]),
clap::Command::new("action").args([
clap::Arg::new("set-true")
.long("set-true")
Expand Down
Loading

0 comments on commit 5e6095f

Please sign in to comment.