pico-args
An ultra simple CLI arguments parser.
- Only flags, options and free arguments are supported.
- Arguments can be separated by a space or
=
. - No help generation.
- No combined flags (like
-vvv
or-abc
).
Alternatives
The core idea of pico-args
is to provide some "sugar" for arguments parsing without
a lot of overhead (binary or compilation time wise).
There are no point in comparing parsing features, because pico-args
supports
only the bare minimum. So we will compare only the size overhead and compilation time.
There are a lot of arguments parsing implementations, but we will use only two:
Feature | pico-args |
clap |
gumdrop |
---|---|---|---|
Binary overhead | 18.9KiB | 435.1KiB | 23KiB |
Build time | 0.9s | 15s | 31s |
Tested version | 0.1.0 | 2.33.0 | 0.6.0 |
- Binary size overhead was measured by subtracting the
.text
section size of an app with arguments parsing and a hello world app. - Build time was measured using
hyperfine 'cargo clean; cargo build --release'
. - Test projects can be found in
examples/
.
License
MIT