deprecate str escape-glob command (#12018)

# Description
After some iteration on globbing rules, I don't think `str escape-glob`
is needed

# User-Facing Changes
```nushell
❯ let f = "[ab]*.nu"
❯ $f | str escape-glob
Error:   × str escape-glob is deprecated
   ╭─[entry #1:1:6]
 1 │ $f | str escape-glob
   ·      ───────┬───────
   ·             ╰── if you are trying to escape a variable, you don't need to do it now
   ╰────
  help: Remove `str escape-glob` call

[[]ab[]][*].nu
```

# Tests + Formatting
NaN

# After Submitting
NaN
This commit is contained in:
Wind 2024-02-29 20:29:56 +08:00 committed by GitHub
parent f24877ba08
commit 65e5abaa3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -59,6 +59,16 @@ impl Command for SubCommand {
call: &Call,
input: PipelineData,
) -> Result<PipelineData, ShellError> {
nu_protocol::report_error_new(
engine_state,
&ShellError::GenericError {
error: "str escape-glob is deprecated".into(),
msg: "if you are trying to escape a variable, you don't need to do it now".into(),
span: Some(call.head),
help: Some("Remove `str escape-glob` call".into()),
inner: vec![],
},
);
let cell_paths: Vec<CellPath> = call.rest(engine_state, stack, 0)?;
let cell_paths = (!cell_paths.is_empty()).then_some(cell_paths);
let args = Arguments { cell_paths };