Incorrect interpretation of double dash
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
This issue is about -- (perhaps also called: double minus, minus minus, double dash, double hyphen, or something like that, I don't actually know).
At first glance, -- is just a separator between options and arguments – and usually that is correct!
However, it seems that if supplied as argument to an option, then GNU and clap differ:
- GNU says it is NOT a separator, and instead a regular argument.
- clap says it IS a separator, and complains about the missing argument.
$ find -maxdepth 1 -name 'README*' -print0 > ./--
$ hd ./--
00000000 2e 2f 52 45 41 44 4d 45 2e 70 61 63 6b 61 67 65 |./README.package|
00000010 2e 6d 64 00 2e 2f 52 45 41 44 4d 45 2e 6d 64 00 |.md../README.md.|
00000020
$ ~/workspace/gnu/src/du --files0-from --
4 ./README.package.md
8 ./README.md
$ cargo +stable --quiet run du --files0-from --
error: a value is required for '--files0-from <FILE>' but none was supplied
For more information, try '--help'.
[$? = 1]
This probably affects nearly all utils (and not just du). Since this is unfixable in clap, this is yet another point in favor of https://github.com/uutils/coreutils/issues/4254.
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
No repository file or test is named. Start by reproducing the provided GNU du and cargo +stable --quiet run du --files0-from -- commands, then inspect how clap parses --files0-from and compare the scope with uutils/coreutils issue #4254. Done means establishing whether this repository can address the discrepancy or documenting why it belongs elsewhere.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100