added pattern tokens help argument
This commit is contained in:
parent
7af9a92785
commit
f9a479f4b5
2 changed files with 22 additions and 2 deletions
13
src/main.rs
13
src/main.rs
|
|
@ -41,7 +41,7 @@ struct Args {
|
|||
decode: Option<String>,
|
||||
|
||||
#[arg(short, long)]
|
||||
/// Generates codes from a user-defined pattern (n = number; l = letter; L = uppercase letter; a = alphanumeric; A = uppercase alphanumeric)
|
||||
/// Generates codes from a user-defined pattern (see --tokens for token list)
|
||||
generate: Option<String>,
|
||||
|
||||
#[arg(short, long, default_value_t = 1)]
|
||||
|
|
@ -53,9 +53,13 @@ struct Args {
|
|||
no_doll: bool,
|
||||
|
||||
#[arg(short, long, default_value_t = false)]
|
||||
/// Specifies the encoding/decoding method as text, not as an integer
|
||||
/// Specifies the encoding/decoding method as text, instead of an integer
|
||||
text: bool,
|
||||
|
||||
#[arg(long, default_value_t = false)]
|
||||
/// List all available pattern tokens
|
||||
tokens: bool,
|
||||
|
||||
#[arg(long)]
|
||||
/// Display the license for dolltool
|
||||
license: bool,
|
||||
|
|
@ -69,6 +73,11 @@ fn main() {
|
|||
process::exit(1);
|
||||
}
|
||||
|
||||
if args.tokens {
|
||||
println!("{}", pattern_gen::TOKEN_HELP);
|
||||
process::exit(0);
|
||||
}
|
||||
|
||||
if let Some(pattern) = args.generate {
|
||||
for _ in 0..args.count {
|
||||
let generated = generate_from_pattern(&pattern);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue