aboutsummaryrefslogtreecommitdiff
path: root/src/cli.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-03-29 13:31:02 +0000
committerFuwn <[email protected]>2021-03-29 13:31:02 +0000
commit5dc613894d6fdd995100a619566823221114dab1 (patch)
tree15d0478c896f198fa702883c50474efaffcf2a11 /src/cli.rs
parentfeature: Implement CLI (diff)
downloadwhirl-5dc613894d6fdd995100a619566823221114dab1.tar.xz
whirl-5dc613894d6fdd995100a619566823221114dab1.zip
feature: Use TOML as config instead of environment variables
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs
new file mode 100644
index 0000000..f59139d
--- /dev/null
+++ b/src/cli.rs
@@ -0,0 +1,25 @@
+use structopt::StructOpt;
+
+#[derive(StructOpt, Debug)]
+pub enum Command {
+ Run,
+ Config,
+}
+
+#[derive(StructOpt, Debug)]
+#[structopt(
+name = env!("CARGO_PKG_NAME"),
+about = env!("CARGO_PKG_DESCRIPTION"),
+version = env!("CARGO_PKG_VERSION"),
+author = env!("CARGO_PKG_AUTHORS"),
+)]
+pub struct Opt {
+ #[structopt(short, long)]
+ pub debug: bool,
+
+ #[structopt(short, long, parse(from_occurrences))]
+ pub verbose: u8,
+
+ #[structopt(subcommand)] // help
+ pub command: Command,
+}