mirror of
https://github.com/nushell/nushell.git
synced 2024-11-26 10:23:52 +01:00
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:
parent
28c07a5072
commit
bc48b4553c
@ -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")]
|
||||
|
@ -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,
|
||||
|
@ -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::*;
|
||||
|
@ -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(
|
5
crates/nu-command/src/misc/mod.rs
Normal file
5
crates/nu-command/src/misc/mod.rs
Normal file
@ -0,0 +1,5 @@
|
||||
mod history;
|
||||
mod tutor;
|
||||
|
||||
pub use history::History;
|
||||
pub use tutor::Tutor;
|
@ -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 {
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user