mirror of
https://github.com/nushell/nushell.git
synced 2025-01-11 08:48:23 +01:00
Update trim_.rs (#8201)
fix typo in help messages # Description _(Thank you for improving Nushell. Please, check our [contributing guide](../CONTRIBUTING.md) and talk to the core team before making major changes.)_ _(Description of your pull request goes here. **Provide examples and/or screenshots** if your changes affect the user experience.)_ # User-Facing Changes _(List of all changes that impact the user experience here. This helps us keep track of breaking changes.)_ # Tests + Formatting Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass # After Submitting If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --------- Co-authored-by: Reilly Wood <reilly.wood@icloud.com>
This commit is contained in:
parent
7c285750c7
commit
b1e7bb899a
@ -39,12 +39,13 @@ impl Command for SubCommand {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("str trim")
|
||||
.input_output_types(vec![(Type::String, Type::String)])
|
||||
.vectorizes_over_list(true)
|
||||
.rest(
|
||||
.input_output_types(vec![(Type::String, Type::String)])
|
||||
.vectorizes_over_list(true)
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"For a data structure input, trim strings at the given cell paths", )
|
||||
"For a data structure input, trim strings at the given cell paths",
|
||||
)
|
||||
.named(
|
||||
"char",
|
||||
SyntaxShape::String,
|
||||
@ -53,21 +54,29 @@ impl Command for SubCommand {
|
||||
)
|
||||
.switch(
|
||||
"left",
|
||||
"trims characters only from the beginning of the string (default: whitespace)",
|
||||
"trims characters only from the beginning of the string",
|
||||
Some('l'),
|
||||
)
|
||||
.switch(
|
||||
"right",
|
||||
"trims characters only from the end of the string (default: whitespace)",
|
||||
"trims characters only from the end of the string",
|
||||
Some('r'),
|
||||
)
|
||||
.switch(
|
||||
"all",
|
||||
"trims all characters from both sides of the string *and* in the middle (default: whitespace)",
|
||||
"trims all characters from both sides of the string *and* in the middle",
|
||||
Some('a'),
|
||||
)
|
||||
.switch("both", "trims all characters from left and right side of the string (default: whitespace)", Some('b'))
|
||||
.switch("format", "trims spaces replacing multiple characters with singles in the middle (default: whitespace)", Some('f'))
|
||||
.switch(
|
||||
"both",
|
||||
"trims all characters from left and right side of the string",
|
||||
Some('b'),
|
||||
)
|
||||
.switch(
|
||||
"format",
|
||||
"trims spaces replacing multiple characters with singles in the middle",
|
||||
Some('f'),
|
||||
)
|
||||
}
|
||||
fn usage(&self) -> &str {
|
||||
"Trim whitespace or specific character"
|
||||
|
Loading…
Reference in New Issue
Block a user