summaryrefslogtreecommitdiff
path: root/src/args.rs
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2020-01-26 09:17:49 +0100
committerDaniel Mueller <deso@posteo.net>2020-01-26 09:17:49 +0100
commit1d15cfb6b189a21211d0981e4dc462dd15eea55c (patch)
tree5668ddb9edaf73e4b5defa258cd49ecb60feebfc /src/args.rs
parent61b5aff7be250387ce8510138cae773ed3bd6577 (diff)
downloadnitrocli-1d15cfb6b189a21211d0981e4dc462dd15eea55c.tar.gz
nitrocli-1d15cfb6b189a21211d0981e4dc462dd15eea55c.tar.bz2
Make --verbose and --model options global
This patch adds the attribute 'global = true' for the top-level --verbose and --model options, which ensures that they can also be set for subcommands. For example: $ nitrocli status --model pro Instead of only: $ nitrocli --model pro status
Diffstat (limited to 'src/args.rs')
-rw-r--r--src/args.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/args.rs b/src/args.rs
index 57e9743..df93814 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -74,10 +74,10 @@ impl<'io> Stdio for ExecCtx<'io> {
#[structopt(name = "nitrocli")]
struct Args {
/// Increases the log level (can be supplied multiple times)
- #[structopt(short, long, parse(from_occurrences))]
+ #[structopt(short, long, global = true, parse(from_occurrences))]
verbose: u8,
/// Selects the device model to connect to
- #[structopt(short, long, possible_values = &DeviceModel::all_str())]
+ #[structopt(short, long, global = true, possible_values = &DeviceModel::all_str())]
model: Option<DeviceModel>,
#[structopt(subcommand)]
cmd: Command,