Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Categorification: move uncategorized String commands to Category::Strings #9931

Merged
merged 1 commit into from
Aug 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions crates/nu-command/src/strings/str_/case/upcase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use nu_engine::CallExt;
use nu_protocol::ast::Call;
use nu_protocol::ast::CellPath;
use nu_protocol::engine::{Command, EngineState, Stack};
use nu_protocol::Category;
use nu_protocol::{Example, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, Value};

#[derive(Clone)]
Expand Down Expand Up @@ -29,6 +30,7 @@ impl Command for SubCommand {
SyntaxShape::CellPath,
"For a data structure input, convert strings at the given cell paths",
)
.category(Category::Strings)
}

fn usage(&self) -> &str {
Expand Down
2 changes: 2 additions & 0 deletions crates/nu-command/src/strings/str_/substring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use nu_engine::CallExt;
use nu_protocol::ast::Call;
use nu_protocol::ast::CellPath;
use nu_protocol::engine::{Command, EngineState, Stack};
use nu_protocol::Category;
use nu_protocol::{
Example, PipelineData, Range, ShellError, Signature, Span, SyntaxShape, Type, Value,
};
Expand Down Expand Up @@ -69,6 +70,7 @@ impl Command for SubCommand {
SyntaxShape::CellPath,
"For a data structure input, turn strings at the given cell paths into substrings",
)
.category(Category::Strings)
}

fn usage(&self) -> &str {
Expand Down
2 changes: 2 additions & 0 deletions crates/nu-command/src/strings/str_/trim/trim_.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use nu_cmd_base::input_handler::{operate, CmdArgument};
use nu_engine::CallExt;
use nu_protocol::Category;
use nu_protocol::{
ast::{Call, CellPath},
engine::{Command, EngineState, Stack},
Expand Down Expand Up @@ -66,6 +67,7 @@ impl Command for SubCommand {
"trims characters only from the end of the string",
Some('r'),
)
.category(Category::Strings)
}
fn usage(&self) -> &str {
"Trim whitespace or specific character."
Expand Down