summaryrefslogtreecommitdiff
path: root/src/cli.rs
blob: 4ceaf90a2e1aa89c26b8c021334ee816fb20c12c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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),
        )
}