Skip to content

Commit 109f629

Browse files
authored
📝 Update str trim CLI help doc (#11383)
# Description Hi! I updated the samples of `str trim` because there were repeated and clarified the explanations # User-Facing Changes Yes! I send the details here: ![image](https://github.com/nushell/nushell/assets/30557287/e30a5612-4214-4365-8b83-7aefbc0ee825) (`old` is version `88.1` not the latest main) # Tests + Formatting ~~I ran `toolkit check pr` successfully~~ There was a tiny problem, a test I never touched now it's failing ```nu (^echo a | complete) == {stdout: "a\n", exit_code: 0} ``` should output `true` but outputs `false`, both in my running `nu` version and in my PR version This make the test `nu-command::main commands::complete::basic` fail located in `crates\nu-command\tests\commands\complete.rs` # After Submitting I'm not sure if I need to update nushell.github.io, some of the help is auto-generated, but maybe not all? I can file a PR if needed
1 parent ff6a67d commit 109f629

File tree

1 file changed

+4
-9
lines changed
  • crates/nu-command/src/strings/str_/trim

1 file changed

+4
-9
lines changed

crates/nu-command/src/strings/str_/trim/trim_.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,27 +133,22 @@ impl Command for SubCommand {
133133
result: Some(Value::test_string("Nu shell")),
134134
},
135135
Example {
136-
description: "Trim a specific character",
137-
example: "'=== Nu shell ===' | str trim --char '=' | str trim",
138-
result: Some(Value::test_string("Nu shell")),
136+
description: "Trim a specific character (not the whitespace)",
137+
example: "'=== Nu shell ===' | str trim --char '='",
138+
result: Some(Value::test_string(" Nu shell ")),
139139
},
140140
Example {
141141
description: "Trim whitespace from the beginning of string",
142142
example: "' Nu shell ' | str trim --left",
143143
result: Some(Value::test_string("Nu shell ")),
144144
},
145-
Example {
146-
description: "Trim a specific character",
147-
example: "'=== Nu shell ===' | str trim --char '='",
148-
result: Some(Value::test_string(" Nu shell ")),
149-
},
150145
Example {
151146
description: "Trim whitespace from the end of string",
152147
example: "' Nu shell ' | str trim --right",
153148
result: Some(Value::test_string(" Nu shell")),
154149
},
155150
Example {
156-
description: "Trim a specific character",
151+
description: "Trim a specific character only from the end of the string",
157152
example: "'=== Nu shell ===' | str trim --right --char '='",
158153
result: Some(Value::test_string("=== Nu shell ")),
159154
},

0 commit comments

Comments
 (0)