Skip to content

Commit

Permalink
Make --verbose and --model options global
Browse files Browse the repository at this point in the history
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
  • Loading branch information
robinkrahl authored and d-e-s-o committed Jan 26, 2020
1 parent 61b5aff commit 1d15cfb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Unreleased
- Added `structopt` dependency in version `0.3.7`
- Replaced `argparse` with `structopt`
- Removed `argparse` dependency
- Made the `--verbose` and `--model` options global
- Removed vendored dependencies and moved source code into repository
root
- Bumped `nitrokey` dependency to `0.5.1`
Expand Down
4 changes: 2 additions & 2 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1d15cfb

Please sign in to comment.