mirror of
https://github.com/nushell/nushell.git
synced 2025-08-15 15:23:13 +02:00
deprecate --ignore-shell-errors and --ignore-program-errors in do command
This commit is contained in:
@ -69,6 +69,33 @@ impl Command for Do {
|
||||
let block: Closure = call.req(engine_state, caller_stack, 0)?;
|
||||
let rest: Vec<Value> = call.rest(engine_state, caller_stack, 1)?;
|
||||
let ignore_all_errors = call.has_flag(engine_state, caller_stack, "ignore-errors")?;
|
||||
|
||||
if call.has_flag(engine_state, caller_stack, "ignore-shell-errors")? {
|
||||
nu_protocol::report_shell_error(
|
||||
engine_state,
|
||||
&ShellError::GenericError {
|
||||
error: "Deprecated option".into(),
|
||||
msg: "`--ignore-shell-errors` is deprecated and will be removed in 0.102.0."
|
||||
.into(),
|
||||
span: Some(call.head),
|
||||
help: Some("Please use the `--ignore-errors(-i)`".into()),
|
||||
inner: vec![],
|
||||
},
|
||||
);
|
||||
}
|
||||
if call.has_flag(engine_state, caller_stack, "ignore-program-errors")? {
|
||||
nu_protocol::report_shell_error(
|
||||
engine_state,
|
||||
&ShellError::GenericError {
|
||||
error: "Deprecated option".into(),
|
||||
msg: "`--ignore-program-errors` is deprecated and will be removed in 0.102.0."
|
||||
.into(),
|
||||
span: Some(call.head),
|
||||
help: Some("Please use the `--ignore-errors(-i)`".into()),
|
||||
inner: vec![],
|
||||
},
|
||||
);
|
||||
}
|
||||
let ignore_shell_errors = ignore_all_errors
|
||||
|| call.has_flag(engine_state, caller_stack, "ignore-shell-errors")?;
|
||||
let ignore_program_errors = ignore_all_errors
|
||||
|
@ -3,7 +3,7 @@
|
||||
# version = "0.100.1"
|
||||
|
||||
def create_left_prompt [] {
|
||||
let dir = match (do --ignore-shell-errors { $env.PWD | path relative-to $nu.home-path }) {
|
||||
let dir = match (do --ignore-errors { $env.PWD | path relative-to $nu.home-path }) {
|
||||
null => $env.PWD
|
||||
'' => '~'
|
||||
$relative_pwd => ([~ $relative_pwd] | path join)
|
||||
|
Reference in New Issue
Block a user