]>
git.proxmox.com Git - rustc.git/blob - vendor/clap_complete/examples/dynamic.rs
1 use clap
::FromArgMatches
;
4 fn command() -> clap
::Command
{
5 let cmd
= clap
::Command
::new("dynamic")
7 clap
::Arg
::new("input")
10 .value_hint(clap
::ValueHint
::FilePath
),
13 clap
::Arg
::new("format")
16 .value_parser(["json", "yaml", "toml"]),
18 .args_conflicts_with_subcommands(true);
19 clap_complete
::dynamic
::bash
::CompleteCommand
::augment_subcommands(cmd
)
24 let matches
= cmd
.get_matches();
25 if let Ok(completions
) =
26 clap_complete
::dynamic
::bash
::CompleteCommand
::from_arg_matches(&matches
)
28 completions
.complete(&mut command());
30 println
!("{:#?}", matches
);
36 command().debug_assert();