diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 2dda38f..aa6b3bc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,6 +8,16 @@ fn main() { let matches = cli::cli().get_matches(); match matches.subcommand() { + Some(("random", sub_matches)) => { + // TODO: Do something better than unwrap here. + let random_command = sub_matches.subcommand().unwrap(); + match random_command { + ("henchman", _) => { + println!("Generating a random henchman..."); + } + _ => unreachable!() + } + } Some(("roll", sub_matches)) => { let formula = sub_matches.get_one::<String>("FORMULA").expect("required"); match dice::roll_formula(formula) { @@ -15,7 +25,7 @@ fn main() { None => eprintln!("Error: Invalid roll formula or calculation failed.") } } - Some(("random", sub_matches)) => { + Some(("table", sub_matches)) => { let random_tables = RandomTables::new().unwrap(); let table_name = sub_matches.get_one::<String>("TABLE").expect("required"); let output_text = random_tables.roll_table(table_name); |