mirror of
https://github.com/nushell/nushell
synced 2024-12-28 22:13:10 +00:00
add login shell flag (#4175)
This commit is contained in:
parent
89cbfd758d
commit
79c7b20cfd
2 changed files with 13 additions and 6 deletions
|
@ -513,11 +513,6 @@ mod tests {
|
||||||
let args = format!("nu --loglevel={}", level);
|
let args = format!("nu --loglevel={}", level);
|
||||||
ui.parse(&args)?;
|
ui.parse(&args)?;
|
||||||
assert_eq!(ui.loglevel().unwrap(), Ok(level.to_string()));
|
assert_eq!(ui.loglevel().unwrap(), Ok(level.to_string()));
|
||||||
|
|
||||||
let ui = cli_app();
|
|
||||||
let args = format!("nu -l {}", level);
|
|
||||||
ui.parse(&args)?;
|
|
||||||
assert_eq!(ui.loglevel().unwrap(), Ok(level.to_string()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let ui = cli_app();
|
let ui = cli_app();
|
||||||
|
@ -530,6 +525,17 @@ mod tests {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn can_be_login() -> Result<(), ShellError> {
|
||||||
|
let ui = cli_app();
|
||||||
|
ui.parse("nu -l")?;
|
||||||
|
|
||||||
|
let ui = cli_app();
|
||||||
|
ui.parse("nu --login")?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_be_passed_nu_scripts() -> Result<(), ShellError> {
|
fn can_be_passed_nu_scripts() -> Result<(), ShellError> {
|
||||||
let ui = cli_app();
|
let ui = cli_app();
|
||||||
|
|
|
@ -15,6 +15,7 @@ impl WholeStreamCommand for Command {
|
||||||
.switch("skip-plugins", "do not load plugins", None)
|
.switch("skip-plugins", "do not load plugins", None)
|
||||||
.switch("no-history", "don't save history", None)
|
.switch("no-history", "don't save history", None)
|
||||||
.switch("perf", "show startup performance metrics", None)
|
.switch("perf", "show startup performance metrics", None)
|
||||||
|
.switch("login", "start Nu as if it was a login shell", Some('l'))
|
||||||
.named(
|
.named(
|
||||||
"commands",
|
"commands",
|
||||||
SyntaxShape::String,
|
SyntaxShape::String,
|
||||||
|
@ -33,7 +34,7 @@ impl WholeStreamCommand for Command {
|
||||||
"loglevel",
|
"loglevel",
|
||||||
SyntaxShape::String,
|
SyntaxShape::String,
|
||||||
"LEVEL: error, warn, info, debug, trace",
|
"LEVEL: error, warn, info, debug, trace",
|
||||||
Some('l'),
|
None,
|
||||||
)
|
)
|
||||||
.named(
|
.named(
|
||||||
"config-file",
|
"config-file",
|
||||||
|
|
Loading…
Reference in a new issue