Move the history and tutor commands out of core_commands (#5813)

* move history and tutor commands from core to misc

* add in the Misc Category for the history and tutor commands
This commit is contained in:
Michael Angerman 2022-06-16 09:58:38 -07:00 committed by GitHub
parent 28c07a5072
commit bc48b4553c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 17 additions and 8 deletions

View file

@ -16,7 +16,6 @@ mod extern_;
mod for_;
mod help;
mod hide;
mod history;
mod if_;
mod ignore;
mod let_;
@ -24,7 +23,6 @@ mod metadata;
mod module;
pub(crate) mod overlay;
mod source;
mod tutor;
mod use_;
mod version;
@ -46,7 +44,6 @@ pub use extern_::Extern;
pub use for_::For;
pub use help::Help;
pub use hide::Hide;
pub use history::History;
pub use if_::If;
pub use ignore::Ignore;
pub use let_::Let;
@ -54,7 +51,6 @@ pub use metadata::Metadata;
pub use module::Module;
pub use overlay::*;
pub use source::Source;
pub use tutor::Tutor;
pub use use_::Use;
pub use version::Version;
#[cfg(feature = "plugin")]

View file

@ -48,7 +48,6 @@ pub fn create_default_context(cwd: impl AsRef<Path>) -> EngineState {
For,
Help,
Hide,
History,
If,
Ignore,
Overlay,
@ -60,7 +59,6 @@ pub fn create_default_context(cwd: impl AsRef<Path>) -> EngineState {
Metadata,
Module,
Source,
Tutor,
Use,
Version,
};
@ -134,6 +132,12 @@ pub fn create_default_context(cwd: impl AsRef<Path>) -> EngineState {
Zip,
};
// Misc
bind_command! {
History,
Tutor,
};
// Path
bind_command! {
Path,

View file

@ -13,6 +13,7 @@ mod formats;
mod generators;
mod hash;
mod math;
mod misc;
mod network;
mod path;
mod platform;
@ -38,6 +39,7 @@ pub use formats::*;
pub use generators::*;
pub use hash::*;
pub use math::*;
pub use misc::*;
pub use network::*;
pub use path::*;
pub use platform::*;

View file

@ -24,7 +24,7 @@ impl Command for History {
fn signature(&self) -> nu_protocol::Signature {
Signature::build("history")
.switch("clear", "Clears out the history entries", Some('c'))
.category(Category::Core)
.category(Category::Misc)
}
fn run(

View file

@ -0,0 +1,5 @@
mod history;
mod tutor;
pub use history::History;
pub use tutor::Tutor;

View file

@ -28,7 +28,7 @@ impl Command for Tutor {
"Search tutorial for a phrase",
Some('f'),
)
.category(Category::Core)
.category(Category::Misc)
}
fn usage(&self) -> &str {

View file

@ -49,6 +49,7 @@ pub enum Category {
Filters,
Formats,
Math,
Misc,
Network,
Random,
Platform,
@ -76,6 +77,7 @@ impl std::fmt::Display for Category {
Category::Filters => "filters",
Category::Formats => "formats",
Category::Math => "math",
Category::Misc => "misc",
Category::Network => "network",
Category::Random => "random",
Category::Platform => "platform",