From b58819d51e21f5c252d141c47e10ee7897bcf4ab Mon Sep 17 00:00:00 2001 From: Antoine Stevan <44101798+amtoine@users.noreply.github.com> Date: Thu, 19 Oct 2023 07:50:00 +0200 Subject: [PATCH] deprecate `extern-wrapped` and `export extern-wrapped` (#10716) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../src/core_commands/export_extern_wrapped.rs | 14 ++++++++++++-- .../src/core_commands/extern_wrapped.rs | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/crates/nu-cmd-lang/src/core_commands/export_extern_wrapped.rs b/crates/nu-cmd-lang/src/core_commands/export_extern_wrapped.rs index 6c5f60fcd1..8ede857c55 100644 --- a/crates/nu-cmd-lang/src/core_commands/export_extern_wrapped.rs +++ b/crates/nu-cmd-lang/src/core_commands/export_extern_wrapped.rs @@ -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 { + 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()) } diff --git a/crates/nu-cmd-lang/src/core_commands/extern_wrapped.rs b/crates/nu-cmd-lang/src/core_commands/extern_wrapped.rs index d54ea1e49a..4919a60b01 100644 --- a/crates/nu-cmd-lang/src/core_commands/extern_wrapped.rs +++ b/crates/nu-cmd-lang/src/core_commands/extern_wrapped.rs @@ -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 { + 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()) }