Move history into their own module (#11308)

# Description

Since there are plans to add more history commands, it seems sensible to
put them into their own module and category

https://github.com/nushell/nushell/pull/10440#issuecomment-1731408785

# User-Facing Changes

The history commands are in the category "History" rather than "Misc"
This commit is contained in:
Hofer-Julian 2023-12-15 13:17:12 +01:00 committed by GitHub
parent 156232fe08
commit 50102bf69b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 5 deletions

View file

@ -34,7 +34,7 @@ impl Command for History {
"Show long listing of entries for sqlite history",
Some('l'),
)
.category(Category::Misc)
.category(Category::History)
}
fn run(

View file

@ -18,7 +18,7 @@ impl Command for HistorySession {
fn signature(&self) -> nu_protocol::Signature {
Signature::build("history session")
.category(Category::Misc)
.category(Category::History)
.input_output_types(vec![(Type::Nothing, Type::Int)])
}

View file

@ -0,0 +1,5 @@
mod history_;
mod history_session;
pub use history_::History;
pub use history_session::HistorySession;

View file

@ -1,15 +1,13 @@
mod commandline;
mod default_context;
mod history;
mod history_session;
mod keybindings;
mod keybindings_default;
mod keybindings_list;
mod keybindings_listen;
pub use commandline::Commandline;
pub use history::History;
pub use history_session::HistorySession;
pub use history::{History, HistorySession};
pub use keybindings::Keybindings;
pub use keybindings_default::KeybindingsDefault;
pub use keybindings_list::KeybindingsList;

View file

@ -58,6 +58,7 @@ pub enum Category {
Formats,
Generators,
Hash,
History,
Math,
Misc,
Network,
@ -91,6 +92,7 @@ impl std::fmt::Display for Category {
Category::Formats => "formats",
Category::Generators => "generators",
Category::Hash => "hash",
Category::History => "history",
Category::Math => "math",
Category::Misc => "misc",
Category::Network => "network",