WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@eatradish
Copy link
Contributor

Like:

fn main() {
    use clap::Command;
    Command::new("myprog")
        .arg(
            Arg::new("test")
                .long("test")
                .action(ArgAction::SetTrue)
                .visible_alias("b")
                .aliases_heading("又叫")
        )
        .print_help()
        .unwrap();
}

Will output:

Usage: myprog [OPTIONS]

Options:
      --test  [又叫: --b]
      -h, --help  Print help

- Add `Command::subcommand_aliases_heading` / `Command::get_subcommand_aliases_heading` api
- Add `Arg::aliases_heading` / `Arg::get_aliases_heading` api
- Add `Arg::default_heading` / `Arg::get_default_heading` api
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant