summaryrefslogtreecommitdiff
path: root/src/cli.rs
diff options
context:
space:
mode:
authorDavid Gay <eapoems@riseup.net>2023-10-16 15:48:29 -0400
committerDavid Gay <eapoems@riseup.net>2023-10-16 15:48:29 -0400
commit5ecd591a49c78f6059fc840ed5551ef7f5cad895 (patch)
tree2d4256d46d58aed2a7928d67542e9001c4259d3f /src/cli.rs
parent152cc94968badba24593a69d6d9917a6638ac659 (diff)
CSV output for random henchmen
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 226b06a..4fdef22 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -1,4 +1,6 @@
-use clap::{arg, crate_authors, crate_description, crate_name, crate_version, Command};
+use clap::{
+ arg, crate_authors, crate_description, crate_name, crate_version, Arg, ArgAction, Command,
+};
pub fn cli() -> Command {
Command::new(crate_name!())
@@ -12,7 +14,16 @@ pub fn cli() -> Command {
Command::new("random")
.about("Generates a random something")
.args_conflicts_with_subcommands(true)
- .subcommand(Command::new("henchman").about("Generates a random henchman"))
+ .subcommand(
+ Command::new("henchman")
+ .about("Generates a random henchman")
+ .arg(
+ Arg::new("csv")
+ .long("csv")
+ .action(ArgAction::SetTrue)
+ .help("Output in CSV format"),
+ ),
+ )
.subcommand(Command::new("magic").about("Generates a magic item")),
)
.subcommand(