diff --git a/crates/nu-cmd-extra/src/extra/mod.rs b/crates/nu-cmd-extra/src/extra/mod.rs index a4a855a10..2f65f9292 100644 --- a/crates/nu-cmd-extra/src/extra/mod.rs +++ b/crates/nu-cmd-extra/src/extra/mod.rs @@ -85,8 +85,6 @@ pub fn add_extra_command_context(mut engine_state: EngineState) -> EngineState { bind_command!( strings::format::Format, - strings::format::FileSize, - strings::format::FormatDuration, strings::encode_decode::EncodeHex, strings::encode_decode::DecodeHex, strings::str_::case::Str, diff --git a/crates/nu-cmd-extra/src/extra/strings/format/mod.rs b/crates/nu-cmd-extra/src/extra/strings/format/mod.rs index 582ad120c..98fd4aea3 100644 --- a/crates/nu-cmd-extra/src/extra/strings/format/mod.rs +++ b/crates/nu-cmd-extra/src/extra/strings/format/mod.rs @@ -1,7 +1,3 @@ mod command; -mod duration; -mod filesize; pub(crate) use command::Format; -pub(crate) use duration::FormatDuration; -pub(crate) use filesize::FileSize; diff --git a/crates/nu-command/src/default_context.rs b/crates/nu-command/src/default_context.rs index 54a404105..fa364645d 100644 --- a/crates/nu-command/src/default_context.rs +++ b/crates/nu-command/src/default_context.rs @@ -192,7 +192,9 @@ pub fn add_shell_command_context(mut engine_state: EngineState) -> EngineState { StrSubstring, StrTrim, StrUpcase, - FormatDate + FormatDate, + FormatDuration, + FormatFilesize, }; // FileSystem diff --git a/crates/nu-cmd-extra/src/extra/strings/format/duration.rs b/crates/nu-command/src/strings/format/duration.rs similarity index 100% rename from crates/nu-cmd-extra/src/extra/strings/format/duration.rs rename to crates/nu-command/src/strings/format/duration.rs diff --git a/crates/nu-cmd-extra/src/extra/strings/format/filesize.rs b/crates/nu-command/src/strings/format/filesize.rs similarity index 97% rename from crates/nu-cmd-extra/src/extra/strings/format/filesize.rs rename to crates/nu-command/src/strings/format/filesize.rs index c51e41264..0ad430c7a 100644 --- a/crates/nu-cmd-extra/src/extra/strings/format/filesize.rs +++ b/crates/nu-command/src/strings/format/filesize.rs @@ -19,9 +19,9 @@ impl CmdArgument for Arguments { } #[derive(Clone)] -pub struct FileSize; +pub struct FormatFilesize; -impl Command for FileSize { +impl Command for FormatFilesize { fn name(&self) -> &str { "format filesize" } @@ -129,6 +129,6 @@ mod tests { fn test_examples() { use crate::test_examples; - test_examples(FileSize) + test_examples(FormatFilesize) } } diff --git a/crates/nu-command/src/strings/format/mod.rs b/crates/nu-command/src/strings/format/mod.rs index 635a9568f..6802b2085 100644 --- a/crates/nu-command/src/strings/format/mod.rs +++ b/crates/nu-command/src/strings/format/mod.rs @@ -1,3 +1,7 @@ mod date; +mod duration; +mod filesize; +pub use self::filesize::FormatFilesize; pub use date::FormatDate; +pub use duration::FormatDuration; diff --git a/crates/nu-command/src/strings/mod.rs b/crates/nu-command/src/strings/mod.rs index 5f1694a02..2d47afc57 100644 --- a/crates/nu-command/src/strings/mod.rs +++ b/crates/nu-command/src/strings/mod.rs @@ -10,7 +10,7 @@ mod str_; pub use char_::Char; pub use detect_columns::*; pub use encode_decode::*; -pub use format::FormatDate; +pub use format::*; pub use parse::*; pub use size::Size; pub use split::*;