aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2020-02-02 12:15:10 +0100
committerDaniel Mueller <deso@posteo.net>2020-09-01 21:20:50 -0700
commit40c8afc198452f33753d72fb64858a34b53a7314 (patch)
tree02500c1dba5cc1ee0af860ed68bba0612ed9705b /src
parentcbd0115cf2d746f5ccde212696376642cee950f9 (diff)
downloadnitrocli-40c8afc198452f33753d72fb64858a34b53a7314.tar.gz
nitrocli-40c8afc198452f33753d72fb64858a34b53a7314.tar.bz2
Add --no-cache option to bypass PIN cache
This patch adds a new --no-cache option that corresponds to the NITROCLI_NO_CACHE environment variable and the no_cache configuration. This makes the user interface more consistent as all configuration items are now backed by both an environment variable and a command-line option.
Diffstat (limited to 'src')
-rw-r--r--src/args.rs3
-rw-r--r--src/config.rs3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/args.rs b/src/args.rs
index 7f2dc31..5a4b312 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -27,6 +27,9 @@ pub struct Args {
/// Selects the device model to connect to
#[structopt(short, long, global = true, possible_values = &DeviceModel::all_str())]
pub model: Option<DeviceModel>,
+ /// Disables the cache for all secrets.
+ #[structopt(long, global = true)]
+ pub no_cache: bool,
#[structopt(subcommand)]
pub cmd: Command,
}
diff --git a/src/config.rs b/src/config.rs
index d146c14..0a220a5 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -65,6 +65,9 @@ impl Config {
if args.model.is_some() {
self.model = args.model;
}
+ if args.no_cache {
+ self.no_cache = true;
+ }
if args.verbose > 0 {
self.verbosity = args.verbose;
}