From a2ce91da2b4d59f2353c19d6ae53c193db42be27 Mon Sep 17 00:00:00 2001 From: Gal Schlezinger Date: Mon, 9 Nov 2020 10:27:35 +0200 Subject: [PATCH] Make config arguments globally available on all commands (#326) Fixes #325 --- src/config.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/config.rs b/src/config.rs index 117381a..af9eb01 100644 --- a/src/config.rs +++ b/src/config.rs @@ -8,12 +8,13 @@ pub struct FnmConfig { #[structopt( long, env = "FNM_NODE_DIST_MIRROR", - default_value = "https://nodejs.org/dist" + default_value = "https://nodejs.org/dist", + global = true )] pub node_dist_mirror: reqwest::Url, /// The root directory of fnm installations. - #[structopt(long = "fnm-dir", env = "FNM_DIR")] + #[structopt(long = "fnm-dir", env = "FNM_DIR", global = true)] pub base_dir: Option, /// Where the current node version link is stored. @@ -28,7 +29,7 @@ pub struct FnmConfig { multishell_path: Option, /// The log level of fnm commands - #[structopt(long, env = "FNM_LOGLEVEL", default_value = "info")] + #[structopt(long, env = "FNM_LOGLEVEL", default_value = "info", global = true)] log_level: LogLevel, }