mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 23:07:46 +02:00
deprecate --ignore-shell-errors and --ignore-program-errors in do
(#14385)
# Description As title, this pr is going to deprecate `--ignore-shell-errors` and `--ignore-program-errors`. Because I think these two flags makes `do` command complicate, and it should be easy to use `-i` instead. # User-Facing Changes After the pr, using these two flags will raise deprecated warning. ```nushell > do --ignore-program-errors { ^pwd } Error: × Deprecated option ╭─[entry #2:1:1] 1 │ do --ignore-program-errors { ^pwd } · ─┬ · ╰── `--ignore-program-errors` is deprecated and will be removed in 0.102.0. ╰──── help: Please use the `--ignore-errors(-i)` /home/windsoilder/projects/nushell > do --ignore-shell-errors { ^pwd } Error: × Deprecated option ╭─[entry #3:1:1] 1 │ do --ignore-shell-errors { ^pwd } · ─┬ · ╰── `--ignore-shell-errors` is deprecated and will be removed in 0.102.0. ╰──── help: Please use the `--ignore-errors(-i)` /home/windsoilder/projects/nushell ``` # Tests + Formatting NaN
This commit is contained in:
@ -44,7 +44,7 @@ fn do_with_semicolon_break_on_failed_external() {
|
||||
fn ignore_shell_errors_works_for_external_with_semicolon() {
|
||||
let actual = nu!(r#"do -s { open asdfasdf.txt }; "text""#);
|
||||
|
||||
assert_eq!(actual.err, "");
|
||||
assert!(actual.err.contains("Deprecated option"));
|
||||
assert_eq!(actual.out, "text");
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ fn ignore_shell_errors_works_for_external_with_semicolon() {
|
||||
fn ignore_program_errors_works_for_external_with_semicolon() {
|
||||
let actual = nu!(r#"do -p { nu -n -c 'exit 1' }; "text""#);
|
||||
|
||||
assert_eq!(actual.err, "");
|
||||
assert!(actual.err.contains("Deprecated option"));
|
||||
assert_eq!(actual.out, "text");
|
||||
}
|
||||
|
||||
@ -80,6 +80,7 @@ fn run_closure_with_it_using() {
|
||||
#[test]
|
||||
fn waits_for_external() {
|
||||
let actual = nu!(r#"do -p { nu -c 'sleep 1sec; print before; exit 1'}; print after"#);
|
||||
assert!(actual.err.is_empty());
|
||||
|
||||
assert!(actual.err.contains("Deprecated option"));
|
||||
assert_eq!(actual.out, "beforeafter");
|
||||
}
|
||||
|
Reference in New Issue
Block a user