diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2020-04-28 19:51:18 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2020-04-28 20:27:15 +0200 |
commit | b2bb2d91d824b395c17e72c81aa3efd2574d6e0f (patch) | |
tree | c4b9ab9b1c3ce5eee083455591a43e403b56d6e8 /src | |
parent | 7533256d9ab21d455ad5691c2a68940bd30b72d9 (diff) |
Add simple CLI definition for later
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/cli.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs new file mode 100644 index 0000000..dddff76 --- /dev/null +++ b/src/cli.rs @@ -0,0 +1,21 @@ +use std::path::PathBuf; + +use structopt::StructOpt; +use failure::Error; + +#[derive(Debug, StructOpt)] +#[structopt(name = "example", about = "An example of StructOpt usage.")] +pub struct CLI { + #[structopt(short, long)] + debug: bool, + + #[structopt(short, long)] + trace: bool, + + #[structopt(parse(from_os_str))] + configfile: Option<PathBuf>, +} + +pub fn cli() -> Result<CLI, Error> { + Ok(CLI::from_args()) +} |