From db3f3eaf5abea8acc8492ff070eef400ef8448ef Mon Sep 17 00:00:00 2001 From: Justin Ma Date: Sun, 22 Oct 2023 00:04:37 +0800 Subject: [PATCH] Move `ansi link` from extra to default feature, close #10792 (#10801) # Description Move `ansi link` from extra to default feature, close #10792 # User-Facing Changes # Tests + Formatting # After Submitting --- crates/nu-cmd-extra/src/extra/mod.rs | 2 +- crates/nu-cmd-extra/src/extra/platform/ansi/mod.rs | 2 -- crates/nu-command/src/default_context.rs | 1 + .../src/extra => nu-command/src}/platform/ansi/link.rs | 0 crates/nu-command/src/platform/ansi/mod.rs | 2 ++ crates/nu-command/src/platform/mod.rs | 2 +- 6 files changed, 5 insertions(+), 4 deletions(-) rename crates/{nu-cmd-extra/src/extra => nu-command/src}/platform/ansi/link.rs (100%) diff --git a/crates/nu-cmd-extra/src/extra/mod.rs b/crates/nu-cmd-extra/src/extra/mod.rs index e88adba999..0b25d9408f 100644 --- a/crates/nu-cmd-extra/src/extra/mod.rs +++ b/crates/nu-cmd-extra/src/extra/mod.rs @@ -62,7 +62,7 @@ pub fn add_extra_command_context(mut engine_state: EngineState) -> EngineState { filters::Rotate ); - bind_command!(platform::ansi::Gradient, platform::ansi::Link); + bind_command!(platform::ansi::Gradient); bind_command!( strings::format::Format, diff --git a/crates/nu-cmd-extra/src/extra/platform/ansi/mod.rs b/crates/nu-cmd-extra/src/extra/platform/ansi/mod.rs index 8a5aa6955a..036fa1e34b 100644 --- a/crates/nu-cmd-extra/src/extra/platform/ansi/mod.rs +++ b/crates/nu-cmd-extra/src/extra/platform/ansi/mod.rs @@ -1,5 +1,3 @@ mod gradient; -mod link; pub(crate) use gradient::SubCommand as Gradient; -pub(crate) use link::SubCommand as Link; diff --git a/crates/nu-command/src/default_context.rs b/crates/nu-command/src/default_context.rs index 9b78a8a87e..6b63204aa1 100644 --- a/crates/nu-command/src/default_context.rs +++ b/crates/nu-command/src/default_context.rs @@ -220,6 +220,7 @@ pub fn add_shell_command_context(mut engine_state: EngineState) -> EngineState { // Platform bind_command! { Ansi, + AnsiLink, AnsiStrip, Clear, Du, diff --git a/crates/nu-cmd-extra/src/extra/platform/ansi/link.rs b/crates/nu-command/src/platform/ansi/link.rs similarity index 100% rename from crates/nu-cmd-extra/src/extra/platform/ansi/link.rs rename to crates/nu-command/src/platform/ansi/link.rs diff --git a/crates/nu-command/src/platform/ansi/mod.rs b/crates/nu-command/src/platform/ansi/mod.rs index 60a03c77c2..a8eb5bfa93 100644 --- a/crates/nu-command/src/platform/ansi/mod.rs +++ b/crates/nu-command/src/platform/ansi/mod.rs @@ -1,5 +1,7 @@ mod ansi_; +mod link; mod strip; pub use ansi_::AnsiCommand as Ansi; +pub use link::SubCommand as AnsiLink; pub use strip::SubCommand as AnsiStrip; diff --git a/crates/nu-command/src/platform/mod.rs b/crates/nu-command/src/platform/mod.rs index a8db9676ad..1a5bc50e03 100644 --- a/crates/nu-command/src/platform/mod.rs +++ b/crates/nu-command/src/platform/mod.rs @@ -7,7 +7,7 @@ mod kill; mod sleep; mod term_size; -pub use ansi::{Ansi, AnsiStrip}; +pub use ansi::{Ansi, AnsiLink, AnsiStrip}; pub use clear::Clear; pub use dir_info::{DirBuilder, DirInfo, FileInfo}; pub use du::Du;