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.
This commit is contained in:
Leon 2023-01-11 05:46:50 +10:00 committed by GitHub
parent f609a4f26a
commit 3a59ab9f14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)