Add alias, aliases and hide_aliases to examples

This commit is contained in:
TheAwiteb 2023-09-25 21:12:27 +03:00
parent 67670e19d3
commit 232c9c7d77
No known key found for this signature in database
GPG key ID: ABF818BD15DC2D34

View file

@ -15,11 +15,13 @@ async fn main() {
#[command(rename_rule = "lowercase")] #[command(rename_rule = "lowercase")]
enum Command { enum Command {
/// Display this text. /// Display this text.
#[command(aliases = ["h", "?"])]
Help, Help,
/// Handle a username. /// Handle a username.
#[command(alias = "u")]
Username(String), Username(String),
/// Handle a username and an age. /// Handle a username and an age.
#[command(parse_with = "split")] #[command(parse_with = "split", alias = "ua", hide_aliases)]
UsernameAndAge { username: String, age: u8 }, UsernameAndAge { username: String, age: u8 },
} }