mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 06:44:16 +00:00
refactor(complete): Add an alias for the subcommand
I want to add support for completion of arguments for aliased subcommands so it's nice to have an example to test on.
This commit is contained in:
parent
6bc8d2632c
commit
5020d739d5
2 changed files with 2 additions and 0 deletions
|
@ -30,6 +30,7 @@ struct Opt {
|
|||
|
||||
#[derive(Subcommand, Debug, PartialEq)]
|
||||
enum Commands {
|
||||
#[clap(visible_alias = "hint")]
|
||||
ValueHint(ValueHintOpt),
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ use std::io;
|
|||
|
||||
fn build_cli() -> Command {
|
||||
let value_hint_command = Command::new("value-hint")
|
||||
.visible_alias("hint")
|
||||
.arg(
|
||||
Arg::new("unknown")
|
||||
.long("unknown")
|
||||
|
|
Loading…
Reference in a new issue