du: error: the argument '--human-readable' cannot be used multiple times (but works in GNU)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
Hi,
To reproduce:
du -h -h
or:
alias du='du -h'
du -h
(I have this setup on most machines, but my muscle memory still contains -h...)
Actual output:
error: the argument '--human-readable' cannot be used multiple times
Expected output (for example):
0
GNU coreutils accepts multiple idempotent arguments. uutils should do the same.
I noticed there are a few bugs on this theme, many from 2020/2021, and in fact du itself has many arguments which should be accepted multiple times (e.g. --si, -s, -x, -c etc.) In fact almost all arguments can be safely passed multiple times with no ambiguity.
Do you want a separate bug for each argument, or each tool, or something else?
Thanks!
Bruce
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with du -h -h and the alias example, then locate the du argument parsing entry point. Done means repeated idempotent options such as --human-readable no longer produce an error and the command matches the expected output; no file or test is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100