From 3a59ab9f14ec1a6d564ce944179db279ae820ae7 Mon Sep 17 00:00:00 2001 From: Leon Date: Wed, 11 Jan 2023 05:46:50 +1000 Subject: [PATCH] Improve wording of `str replace` help messages (#7708) # Description See title. # User-Facing Changes See title. # 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. --- crates/nu-command/src/strings/str_/replace.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/nu-command/src/strings/str_/replace.rs b/crates/nu-command/src/strings/str_/replace.rs index ba042729e4..b35e604a68 100644 --- a/crates/nu-command/src/strings/str_/replace.rs +++ b/crates/nu-command/src/strings/str_/replace.rs @@ -36,21 +36,21 @@ impl Command for SubCommand { .input_output_types(vec![(Type::String, Type::String)]) .vectorizes_over_list(true) .required("find", SyntaxShape::String, "the pattern to find") - .required("replace", SyntaxShape::String, "the replacement pattern") + .required("replace", SyntaxShape::String, "the replacement string") .rest( "rest", SyntaxShape::CellPath, "For a data structure input, operate on strings at the given cell paths", ) - .switch("all", "replace all occurrences of find string", Some('a')) + .switch("all", "replace all occurrences of the pattern", Some('a')) .switch( "no-expand", - "do not expand the replace parameter as a regular expression", + "do not expand capture groups (like $name) in the replacement string", Some('n'), ) .switch( "string", - "do not use regular expressions for string find and replace", + "match the pattern as a substring of the input, instead of a regular expression", Some('s'), ) .category(Category::Strings)