deprecate extern-wrapped and export extern-wrapped (#10716)

follow-up to
- https://github.com/nushell/nushell/pull/10566

# Description
this PR deprecates the use of `extern-wrapped` and `export
extern-wrapped`

these two core commands will be removed in 0.88

# User-Facing Changes
using `extern-wrapped` will give a warning
```nushell
> extern-wrapped foo [...args] { print "foo" }; foo
Error:   × Deprecated command
   ╭─[entry #2:1:1]
 1 │ extern-wrapped foo [...args] { print "foo" }; foo
   · ───────┬──────
   ·        ╰── `extern-wrapped` is deprecated and will be removed in 0.88.
   ╰────
  help: Use `def --wrapped` instead


foo
```

# Tests + Formatting

# After Submitting
This commit is contained in:
Antoine Stevan 2023-10-19 07:50:00 +02:00 committed by GitHub
parent 9692240b4f
commit b58819d51e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 4 deletions

View file

@ -34,11 +34,21 @@ impl Command for ExportExternWrapped {
fn run(
&self,
_engine_state: &EngineState,
engine_state: &EngineState,
_stack: &mut Stack,
_call: &Call,
call: &Call,
_input: PipelineData,
) -> Result<PipelineData, ShellError> {
nu_protocol::report_error_new(
engine_state,
&ShellError::GenericError(
"Deprecated command".into(),
"`export extern-wrapped` is deprecated and will be removed in 0.88.".into(),
Some(call.head),
Some("Use `export def --wrapped` instead".into()),
vec![],
),
);
Ok(PipelineData::empty())
}

View file

@ -37,11 +37,21 @@ impl Command for ExternWrapped {
fn run(
&self,
_engine_state: &EngineState,
engine_state: &EngineState,
_stack: &mut Stack,
_call: &Call,
call: &Call,
_input: PipelineData,
) -> Result<PipelineData, ShellError> {
nu_protocol::report_error_new(
engine_state,
&ShellError::GenericError(
"Deprecated command".into(),
"`extern-wrapped` is deprecated and will be removed in 0.88.".into(),
Some(call.head),
Some("Use `def --wrapped` instead".into()),
vec![],
),
);
Ok(PipelineData::empty())
}