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:
Martin von Zweigbergk 2022-09-27 21:29:06 -07:00
parent 6bc8d2632c
commit 5020d739d5
2 changed files with 2 additions and 0 deletions

View file

@ -30,6 +30,7 @@ struct Opt {
#[derive(Subcommand, Debug, PartialEq)]
enum Commands {
#[clap(visible_alias = "hint")]
ValueHint(ValueHintOpt),
}

View file

@ -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")