pub struct CliOverrides {
pub config_home: Option<PathBuf>,
pub config_file: Option<PathBuf>,
pub env_file: Option<PathBuf>,
}Expand description
CLI flags that affect where configuration files are found.
Only path-resolution flags belong here. Flags that control whether config
files are loaded (e.g. --no-config-file) stay in NushellCliArgs.
Relative paths are resolved against the provided cwd in
CliOverrides::from_path_strings — that is the single place absolute-ization
of CLI path overrides happens.
Fields§
§config_home: Option<PathBuf>--config-home <path> — override the entire nushell config directory
config_file: Option<PathBuf>--config <file> — override config.nu path
env_file: Option<PathBuf>--env-config <file> — override env.nu path
Implementations§
Source§impl CliOverrides
impl CliOverrides
Sourcepub fn from_path_strings(
config_home: Option<&str>,
config_file: Option<&str>,
env_file: Option<&str>,
cwd: &Path,
) -> Self
pub fn from_path_strings( config_home: Option<&str>, config_file: Option<&str>, env_file: Option<&str>, cwd: &Path, ) -> Self
Build overrides from optional CLI path strings, resolving any relative
path against cwd.
This is the only place CLI config path absolute-ization should live.
Resolution is logical (not realpath): tilde is expanded via the
user’s home directory, relative segments are joined to cwd, and . /
.. are stripped lexically. Symlinks in the path are not followed.
Trait Implementations§
Source§impl Clone for CliOverrides
impl Clone for CliOverrides
Source§fn clone(&self) -> CliOverrides
fn clone(&self) -> CliOverrides
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more