Consider using a smaller command line argument parser
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.9k
- Forks
- 180
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 2
Description
clap constitutes roughly 80% of sudo's binary size. According to this we have various choices that are significantly smaller:
https://github.com/rosetta-rs/argparse-rosetta-rs#results
Among those, pico-args seems to be the 2nd most popular choice and it's 30x smaller and 10x faster to compile. argh was authored by Google and may receive continued support as well. This clap issue seems relevant: https://github.com/clap-rs/clap/issues/1365
Since other, smaller parsers often don't support builtin formatting for --help we'd probably have to write that ourselves, however for sudo I suspect a simple, static string is sufficient.
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 files, tests, or entry points are identified. Start by locating the current clap integration, then compare pico-args and argh against sudo's parsing and help requirements. Done would mean selecting and adopting a smaller parser while preserving the needed command-line behavior and validating the binary-size and compile-time impact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100