rust_unique_pass/cli/
cli.rs1use clap::Parser;
2
3#[derive(Parser, Debug, PartialEq)]
7pub struct RupassArgs {
8 #[clap(
10 short = 'l',
11 long = "language",
12 value_name = "LANGUAGE",
13 help = "Specifies the language for user prompts and messages.\
14 \nSpecify the language code as defined by ISO639-3.\
15 \nSupported languages: Japanese, English, and German.\
16 \nDefault language: English"
17 )]
18 pub language: Option<String>,
19
20 #[clap(
22 short = 'p',
23 long = "password-length",
24 value_name = "PASSWORD_LENGTH",
25 help = "Specify the length of the password. \
26 \nIf omitted, a default length is used."
27 )]
28 pub password_length: Option<usize>,
29
30 #[clap(
32 short = 'n',
33 long = "numbers",
34 help = "Include numbers in the password."
35 )]
36 pub numbers: bool,
37
38 #[clap(
40 short = 'u',
41 long = "uppercase",
42 help = "Include uppercase letters in the password."
43 )]
44 pub uppercase: bool,
45
46 #[clap(
48 short = 'w',
49 long = "lowercase",
50 help = "Include lowercase letters in the password."
51 )]
52 pub lowercase: bool,
53
54 #[clap(
56 short = 's',
57 long = "symbols",
58 help = "Include symbols in passwords.\
59 \nBy default, the symbols ~!@#$%^&*_-+=(){}[]:;<>,.?/ are used.\
60 \nYou can change which special symbols are used."
61 )]
62 pub symbols: bool,
63}
64
65#[doc(alias = "parse")]
69#[doc(alias = "args")]
70pub fn parse_args() -> RupassArgs {
71 RupassArgs::parse()
72}