From b1e7bb899a5554b397b33971a8680684ca1a9ad8 Mon Sep 17 00:00:00 2001 From: baehyunsol <47506131+baehyunsol@users.noreply.github.com> Date: Sat, 25 Feb 2023 15:18:20 +0900 Subject: [PATCH] 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 --- .../nu-command/src/strings/str_/trim/trim_.rs | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/crates/nu-command/src/strings/str_/trim/trim_.rs b/crates/nu-command/src/strings/str_/trim/trim_.rs index 863af7407..ea36f29d5 100644 --- a/crates/nu-command/src/strings/str_/trim/trim_.rs +++ b/crates/nu-command/src/strings/str_/trim/trim_.rs @@ -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"