|new 0.4.1||May 3, 2021|
|0.4.0||Jan 3, 2021|
|0.3.4||Aug 9, 2020|
|0.3.3||Jun 26, 2020|
|0.1.0||Jul 21, 2019|
#2 in #args
71,261 downloads per month
Used in 183 crates (47 directly)
An ultra simple CLI arguments parser.
If you think that this library doesn't support some feature, it's probably intentional.
- No help generation.
- Only flags, options, free arguments and subcommands are supported.
- Options can be separated by a space,
=or nothing. See build features.
- Arguments can be in any order.
- Non UTF-8 arguments are supported.
Allows parsing arguments separated by
=. Enabled by default.
This feature adds about 1KiB to the resulting binary.
Makes the space between short keys and their values optional (e.g.
eq-separatoris enabled, then it takes precedence and the '=' is not included.
eq-separatoris disabled, then
-K=valuegives an error instead of returning
The optional space is only applicable for short keys because
--keyvaluewould be ambiguous.
Allows combination of flags, e.g.
-a -b -c. If
eq-separatorare enabled, you must parse flags after values, to prevent ambiguities.
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 since
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 these one:
- clap - is the most popular and complete one
- gumdrop - a simple parser that uses procedural macros
- structopt - a two above combined
- argh - similar to gumdrop
|Number of dependencies||0||0||8||5||20||8|
- Binary size overhead was measured by subtracting the
.textsection 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
No runtime deps