summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cli.rs3
-rw-r--r--src/config/mod.rs3
-rw-r--r--src/main.rs3
3 files changed, 6 insertions, 3 deletions
diff --git a/src/cli.rs b/src/cli.rs
index fd56e8b..5531283 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -27,6 +27,9 @@ pub struct Cli {
/// Print information
#[clap(long)]
pub info: bool,
+ /// Run in dry run mode
+ #[clap(long)]
+ pub dry_run: bool,
/// Input text
text: Vec<String>,
}
diff --git a/src/config/mod.rs b/src/config/mod.rs
index e3d81cb..8b6a6ac 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -480,9 +480,6 @@ impl Config {
}
fn merge_env_vars(&mut self) {
- if let Ok(value) = env::var(get_env_name("dry_run")) {
- set_bool(&mut self.dry_run, &value);
- }
if let Ok(value) = env::var(get_env_name("light_theme")) {
set_bool(&mut self.light_theme, &value);
}
diff --git a/src/main.rs b/src/main.rs
index f8d2eeb..af772ca 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -41,6 +41,9 @@ fn main() -> Result<()> {
.for_each(|(name, _)| println!("{}", name));
exit(0);
}
+ if cli.dry_run {
+ config.write().dry_run = true;
+ }
let role = match &cli.role {
Some(name) => Some(
config