Browse Source

Make config arguments globally available on all commands (#326)

Fixes #325
remotes/origin/add-with-shims
Gal Schlezinger 4 years ago committed by GitHub
parent
commit
a2ce91da2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/config.rs

7
src/config.rs

@ -8,12 +8,13 @@ pub struct FnmConfig {
#[structopt( #[structopt(
long, long,
env = "FNM_NODE_DIST_MIRROR", 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, pub node_dist_mirror: reqwest::Url,
/// The root directory of fnm installations. /// 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<std::path::PathBuf>, pub base_dir: Option<std::path::PathBuf>,
/// Where the current node version link is stored. /// Where the current node version link is stored.
@ -28,7 +29,7 @@ pub struct FnmConfig {
multishell_path: Option<std::path::PathBuf>, multishell_path: Option<std::path::PathBuf>,
/// The log level of fnm commands /// 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, log_level: LogLevel,
} }

Loading…
Cancel
Save