Skip to content

Commit ff12be7

Browse files
committed
Start deprecating dangerout -h/-V aliases
1 parent ff6dd99 commit ff12be7

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

docs/src/extensions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $ ls -w=80
2323
```
2424

2525
With GNU coreutils, `--help` usually prints the help message and `--version` prints the version.
26-
We also commonly provide short options: `-h` for help and `-V` for version.
26+
We also have short aliases for them: `-h` for help and `-V` for version for few utils. But we deprecate them since it cause confusion at some cases e.g. `sort -h`.
2727

2828
## `coreutils`
2929

src/bin/coreutils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fn main() {
7777
match util {
7878
"--list" => {
7979
// If --help is also present, show usage instead of list
80-
if args.any(|arg| arg == "--help" || arg == "-h") {
80+
if args.any(|arg| arg == "--help") {
8181
usage(&utils, binary_as_util);
8282
process::exit(0);
8383
}
@@ -87,7 +87,7 @@ fn main() {
8787
}
8888
process::exit(0);
8989
}
90-
"--version" | "-V" => {
90+
"--version" => {
9191
println!("{binary_as_util} {VERSION} (multi-call binary)");
9292
process::exit(0);
9393
}
@@ -106,7 +106,7 @@ fn main() {
106106
process::exit(uumain(vec![util_os].into_iter().chain(args)));
107107
}
108108
None => {
109-
if util == "--help" || util == "-h" {
109+
if util == "--help" {
110110
// see if they want help on a specific util
111111
if let Some(util_os) = args.next() {
112112
let Some(util) = util_os.to_str() else {

0 commit comments

Comments
 (0)