mirror of
https://github.com/nushell/nushell
synced 2024-12-26 13:03:07 +00:00
cratification: start moving over the math commands to nu-cmd-extra (#9647)
* arccos * arccosh * arcsin * arcsinh * arctan * arctanh The above commands are being ported over to nu-cmd-extra I initially moved all of the math commands over but there are some issues with the tests... So we will move them over slowly --- and actually I kind of like this idea better... Because some of the math commands we might want to leave in the core nushell... Stay tuned... For more details 👍 Read this document: https://github.com/stormasm/nutmp/blob/main/commands/math.md
This commit is contained in:
parent
cf36f052c4
commit
e10d84b72f
10 changed files with 31 additions and 19 deletions
13
crates/nu-cmd-extra/src/extra/math/mod.rs
Normal file
13
crates/nu-cmd-extra/src/extra/math/mod.rs
Normal file
|
@ -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;
|
|
@ -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()
|
||||
};
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue