diff options
Diffstat (limited to 'src/cli.rs')
-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()) +} |