summaryrefslogtreecommitdiff
path: root/src/cli.rs
diff options
context:
space:
mode:
authorDavid Gay <eapoems@riseup.net>2023-09-30 23:14:13 -0400
committerDavid Gay <eapoems@riseup.net>2023-09-30 23:14:13 -0400
commit4e5f2211e0be7d189235bc88b1ca8fef29e77f87 (patch)
treeec03bea631875419ba6614e09f42af5c8a0d3308 /src/cli.rs
parentf92a67d5d0010a1c9825acd7b6ec87580b429272 (diff)
Basic CLI
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs
new file mode 100644
index 0000000..4ceaf90
--- /dev/null
+++ b/src/cli.rs
@@ -0,0 +1,16 @@
+use clap::{arg, Command, crate_authors, crate_description, crate_name, crate_version};
+
+pub fn cli() -> Command {
+ Command::new(crate_name!())
+ .about(crate_description!())
+ .author(crate_authors!())
+ .version(crate_version!())
+ .subcommand_required(true)
+ .arg_required_else_help(true)
+ .allow_external_subcommands(true)
+ .subcommand(Command::new("roll")
+ .about("Rolls dice based on a given formula.")
+ .arg(arg!(<FORMULA> "The dice rolling formula"))
+ .arg_required_else_help(true),
+ )
+}