diff options
| author | Miquel Sabaté Solà <mikisabate@gmail.com> | 2025-07-29 08:12:20 +0200 |
|---|---|---|
| committer | Miquel Sabaté Solà <mikisabate@gmail.com> | 2025-07-29 08:12:20 +0200 |
| commit | 87a7b528482a1850731001ee8ccaccfd75c64824 (patch) | |
| tree | 024744297a9b401c8400dd92f5d0ad6ae908b379 /crates/cli | |
| parent | f28e0459b5918b1b21cba285af0e14c9d223a3b7 (diff) | |
| download | mihi-87a7b528482a1850731001ee8ccaccfd75c64824.tar.gz mihi-87a7b528482a1850731001ee8ccaccfd75c64824.zip | |
Rename from run to practice
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'crates/cli')
| -rw-r--r-- | crates/cli/src/main.rs | 72 |
1 files changed, 35 insertions, 37 deletions
diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index 239891e..db1de33 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -17,7 +17,7 @@ fn help() { println!("Commands:"); println!(" init\t\t\tInitialize the configuration for this application."); println!(" nuke\t\t\tRemove all files from this application and its database."); - println!(" run\t\t\tRun exercises. Default command if none was given."); + println!(" practice\t\tPractice vocabulary/exercises. Default command if none was given."); println!(" words\t\tManage the words for this application."); } @@ -29,44 +29,42 @@ fn main() { args.next(); match args.next() { - Some(command_flag) => { - match command_flag.as_str() { - "-h" | "--help" => { - if nargs > 2 { - println!("warning: arguments passed the 'help' flag will be ignored.\n"); - } - help(); - std::process::exit(0); - }, - "-v" | "--version" => { - if nargs > 2 { - println!("warning: arguments passed the 'version' flag will be ignored.\n"); - } - println!("mihi {VERSION}"); - std::process::exit(0); - }, - "init" => { - let rest: Vec<String> = args.collect(); - init::run(rest); - }, - "nuke" => { - let rest: Vec<String> = args.collect(); - nuke::run(rest); - }, - "words" => { - let rest: Vec<String> = args.collect(); - words::run(rest); - }, - "run" => { - let rest: Vec<String> = args.collect(); - run::run(rest); - }, - _ => { - println!("error: unknown flag or command: '{command_flag}'"); - std::process::exit(1); + Some(command_flag) => match command_flag.as_str() { + "-h" | "--help" => { + if nargs > 2 { + println!("warning: arguments passed the 'help' flag will be ignored.\n"); } + help(); + std::process::exit(0); + } + "-v" | "--version" => { + if nargs > 2 { + println!("warning: arguments passed the 'version' flag will be ignored.\n"); + } + println!("mihi {VERSION}"); + std::process::exit(0); + } + "init" => { + let rest: Vec<String> = args.collect(); + init::run(rest); + } + "nuke" => { + let rest: Vec<String> = args.collect(); + nuke::run(rest); + } + "words" => { + let rest: Vec<String> = args.collect(); + words::run(rest); + } + "practice" => { + let rest: Vec<String> = args.collect(); + run::run(rest); + } + _ => { + println!("error: unknown flag or command: '{command_flag}'"); + std::process::exit(1); } }, - None => run::run(Vec::new()) + None => run::run(Vec::new()), } } |
