refactor: rename subcommand structs (#15309)

Came from [this
discussion](https://discord.com/channels/601130461678272522/1348791953784836147/1349699872059691038)
on discord with @fdncred

# Description
Small refactoring where I rename commands from "SubCommand" to its
proper name. Motivations: better clarity (although subjective), better
searchable, consistency.

The only commands I didn't touch were "split list" and "ansi gradient"
because of name clashes.

# User-Facing Changes
None

# Tests + Formatting
cargo fmt and clippy OK

# After Submitting
nothing required
This commit is contained in:
Loïc Riegel
2025-03-14 02:00:35 +01:00
committed by GitHub
parent 33001d1992
commit 8f634f4140
128 changed files with 439 additions and 439 deletions

View File

@ -1,9 +1,9 @@
use nu_engine::command_prelude::*;
#[derive(Clone)]
pub struct SubCommand;
pub struct CommandlineEdit;
impl Command for SubCommand {
impl Command for CommandlineEdit {
fn name(&self) -> &str {
"commandline edit"
}

View File

@ -2,9 +2,9 @@ use nu_engine::command_prelude::*;
use unicode_segmentation::UnicodeSegmentation;
#[derive(Clone)]
pub struct SubCommand;
pub struct CommandlineGetCursor;
impl Command for SubCommand {
impl Command for CommandlineGetCursor {
fn name(&self) -> &str {
"commandline get-cursor"
}

View File

@ -4,6 +4,6 @@ mod get_cursor;
mod set_cursor;
pub use commandline_::Commandline;
pub use edit::SubCommand as CommandlineEdit;
pub use get_cursor::SubCommand as CommandlineGetCursor;
pub use set_cursor::SubCommand as CommandlineSetCursor;
pub use edit::CommandlineEdit;
pub use get_cursor::CommandlineGetCursor;
pub use set_cursor::CommandlineSetCursor;

View File

@ -3,9 +3,9 @@ use nu_engine::command_prelude::*;
use unicode_segmentation::UnicodeSegmentation;
#[derive(Clone)]
pub struct SubCommand;
pub struct CommandlineSetCursor;
impl Command for SubCommand {
impl Command for CommandlineSetCursor {
fn name(&self) -> &str {
"commandline set-cursor"
}