From 5ecd591a49c78f6059fc840ed5551ef7f5cad895 Mon Sep 17 00:00:00 2001 From: David Gay Date: Mon, 16 Oct 2023 15:48:29 -0400 Subject: CSV output for random henchmen --- src/cli.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/cli.rs') 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( -- cgit v1.2.3