uutils / uutils/coreutils

du: error: the argument '--human-readable' cannot be used multiple times (but works in GNU)

Open
#11,783 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

U - du
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.