Rename uniq --ignore-case long flag name to --insensitive#7191
Rename uniq --ignore-case long flag name to --insensitive#7191webbedspace wants to merge 2 commits intonushell:mainfrom
--ignore-case long flag name to --insensitive#7191Conversation
|
If mine was the only vote, I'd change every existence of |
|
I prefer |
|
+1 for |
|
Your honour, I think the word "sensitive" by itself in a purely programming context pretty much only means "case-sensitive", does it not? So the word "insensitive" has the same meaning. (Meanwhile, we've got at least four commands with |
|
Some prior art: GNU grep: |
These are a little unfair, since the middle two are obliged to copy the API of the first one… Although, a proper manpage search reveals that |
|
@webbedspace one thing that would be helpful is standardizing on |
# Description Support for this breaking change was raised in #7191. This affects `sort`, `sort-by`, `str contains` and `find`. `--ignore-case` is used by a few POSIX programs such as `less` and `grep`, as well as a few other popular utils like `tree` and `wget`. Since long names aren't especially popular (existing primarily for self-documentation purposes), I consider this on the shallow end of the compat-break scale. Note that the `-i` short flag is not affected. # User-Facing Changes See above. # 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 --features=extra -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect` to check that you're using the standard code style - `cargo test --workspace --features=extra` 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.
Description
sort,sort-by,str containsandfindall have a -i flag that controls case-sensitivity. However, unlikeuniq, the expanded version is called--insensitivefor all of these commands. This changesuniqto use the same name. While this is a compat break, since long names aren't especially popular (existing primarily for self-documentation purposes), I consider this on the shallow end of the compat-break scale.uniq -iremains exactly the same.User-Facing Changes
uniq --ignore-case→uniq --insensitive(compat break)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 -- --checkto check standard code formatting (cargo fmt --allapplies these changes)cargo clippy --workspace --features=extra -- -D warnings -D clippy::unwrap_used -A clippy::needless_collectto check that you're using the standard code stylecargo test --workspace --features=extrato check that all tests passAfter Submitting
If your PR had any user-facing changes, update the documentation after the PR is merged, if necessary. This will help us keep the docs up to date.