diff --git a/crates/nu-command/src/math/arccos.rs b/crates/nu-cmd-extra/src/extra/math/arccos.rs similarity index 100% rename from crates/nu-command/src/math/arccos.rs rename to crates/nu-cmd-extra/src/extra/math/arccos.rs diff --git a/crates/nu-command/src/math/arccosh.rs b/crates/nu-cmd-extra/src/extra/math/arccosh.rs similarity index 100% rename from crates/nu-command/src/math/arccosh.rs rename to crates/nu-cmd-extra/src/extra/math/arccosh.rs diff --git a/crates/nu-command/src/math/arcsin.rs b/crates/nu-cmd-extra/src/extra/math/arcsin.rs similarity index 100% rename from crates/nu-command/src/math/arcsin.rs rename to crates/nu-cmd-extra/src/extra/math/arcsin.rs diff --git a/crates/nu-command/src/math/arcsinh.rs b/crates/nu-cmd-extra/src/extra/math/arcsinh.rs similarity index 100% rename from crates/nu-command/src/math/arcsinh.rs rename to crates/nu-cmd-extra/src/extra/math/arcsinh.rs diff --git a/crates/nu-command/src/math/arctan.rs b/crates/nu-cmd-extra/src/extra/math/arctan.rs similarity index 100% rename from crates/nu-command/src/math/arctan.rs rename to crates/nu-cmd-extra/src/extra/math/arctan.rs diff --git a/crates/nu-command/src/math/arctanh.rs b/crates/nu-cmd-extra/src/extra/math/arctanh.rs similarity index 100% rename from crates/nu-command/src/math/arctanh.rs rename to crates/nu-cmd-extra/src/extra/math/arctanh.rs diff --git a/crates/nu-cmd-extra/src/extra/math/mod.rs b/crates/nu-cmd-extra/src/extra/math/mod.rs new file mode 100644 index 0000000000..411f899898 --- /dev/null +++ b/crates/nu-cmd-extra/src/extra/math/mod.rs @@ -0,0 +1,13 @@ +mod arccos; +mod arccosh; +mod arcsin; +mod arcsinh; +mod arctan; +mod arctanh; + +pub use arccos::SubCommand as MathArcCos; +pub use arccosh::SubCommand as MathArcCosH; +pub use arcsin::SubCommand as MathArcSin; +pub use arcsinh::SubCommand as MathArcSinH; +pub use arctan::SubCommand as MathArcTan; +pub use arctanh::SubCommand as MathArcTanH; diff --git a/crates/nu-cmd-extra/src/extra/mod.rs b/crates/nu-cmd-extra/src/extra/mod.rs index ccf9409b8c..8f77bf7dd3 100644 --- a/crates/nu-cmd-extra/src/extra/mod.rs +++ b/crates/nu-cmd-extra/src/extra/mod.rs @@ -3,6 +3,7 @@ mod bytes; mod conversions; mod filters; mod formats; +mod math; mod platform; mod strings; @@ -30,6 +31,13 @@ pub use bits::BitsShl; pub use bits::BitsShr; pub use bits::BitsXor; +pub use math::MathArcCos; +pub use math::MathArcCosH; +pub use math::MathArcSin; +pub use math::MathArcSinH; +pub use math::MathArcTan; +pub use math::MathArcTanH; + use nu_protocol::engine::{EngineState, StateWorkingSet}; pub fn add_extra_command_context(mut engine_state: EngineState) -> EngineState { @@ -98,6 +106,16 @@ pub fn add_extra_command_context(mut engine_state: EngineState) -> EngineState { BytesBuild } + // Math + bind_command! { + MathArcSin, + MathArcCos, + MathArcTan, + MathArcSinH, + MathArcCosH, + MathArcTanH + }; + working_set.render() }; diff --git a/crates/nu-command/src/default_context.rs b/crates/nu-command/src/default_context.rs index 771b945e97..86477dad2e 100644 --- a/crates/nu-command/src/default_context.rs +++ b/crates/nu-command/src/default_context.rs @@ -333,12 +333,6 @@ pub fn add_shell_command_context(mut engine_state: EngineState) -> EngineState { MathSinH, MathCosH, MathTanH, - MathArcSin, - MathArcCos, - MathArcTan, - MathArcSinH, - MathArcCosH, - MathArcTanH, MathPi, MathTau, MathEuler, diff --git a/crates/nu-command/src/math/mod.rs b/crates/nu-command/src/math/mod.rs index b602daee99..520ee6d821 100644 --- a/crates/nu-command/src/math/mod.rs +++ b/crates/nu-command/src/math/mod.rs @@ -1,10 +1,4 @@ mod abs; -mod arccos; -mod arccosh; -mod arcsin; -mod arcsinh; -mod arctan; -mod arctanh; mod avg; mod ceil; mod cos; @@ -59,13 +53,6 @@ pub use sinh::SubCommand as MathSinH; pub use tan::SubCommand as MathTan; pub use tanh::SubCommand as MathTanH; -pub use arccos::SubCommand as MathArcCos; -pub use arccosh::SubCommand as MathArcCosH; -pub use arcsin::SubCommand as MathArcSin; -pub use arcsinh::SubCommand as MathArcSinH; -pub use arctan::SubCommand as MathArcTan; -pub use arctanh::SubCommand as MathArcTanH; - pub use egamma::SubCommand as MathEulerGamma; pub use euler::SubCommand as MathEuler; pub use phi::SubCommand as MathPhi;