microsoft / microsoft/sudo

Consider using a smaller command line argument parser

Open
#69 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Task
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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.