sudo icon indicating copy to clipboard operation
sudo copied to clipboard

Consider using a smaller command line argument parser

Open lhecker opened this issue 1 year ago • 0 comments

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.

lhecker avatar May 01 '24 21:05 lhecker