argh
argparse-benchmarks-rs
argh | argparse-benchmarks-rs | |
---|---|---|
7 | 17 | |
1,568 | 35 | |
1.6% | - | |
6.0 | 6.5 | |
21 days ago | over 1 year ago | |
Rust | Python | |
BSD 3-clause "New" or "Revised" License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
argh
-
Crate List - Blessed.rs
https://github.com/google/argh is another minimal library for CLI argument parsing that could be in the list
-
Rust Web Framework Comparison
My go-to is argh[1], as it's more lightweight while still providing a nice derive-based API.
[1]: https://github.com/google/argh
-
Immediately off the top of your head what is the best Rust CLI library.
It'll panic if the path contains non-UTF8-able bytes.
-
fncmd: Command line interface as a function.
Yes clap needs a lot of boilerplate that small programs don't always need, but if you're going to simplify it, I don't think having a bunch of arguments given to the main function is better than having an option struct as in argh. Such an option struct can be given to other functions from the main, can have dedicated consistency check or completion methods, etc.
-
Newbie frustration: can we KISS more?
Typically programs are configured through a config object. People like to use things like clap, structopt, or argh for passing in arguments through the CLI https://github.com/google/argh. You can also use the env! macro for embedding values in at compile time, or by going through the std::env::var infrastructure for runtime env vars.
-
Darkroom: A VCR contract testing tool built in Rust
Until the argh crate bumps their version I cannot updater the version on crates.io so the install command currently is: cargo install --git https://github.com/mkatychev/darkroom
-
Announcement: xflags, fast-to-compile proc macro for cli args
Ahh. The secondary reason I discounted Argh as "unsuitable for purpose" after "Doesn't support using OsString under the hood".
argparse-benchmarks-rs
-
Yet another command line argument parser: bpaf 0.5.2
You can check out the argparse-benchmarks-rs though that only gives a high level summary.
-
Gex: Git CLI inspired by Emac's Magit built in Rust
So besides the git2 conversation, I'd recommend using an argument parser even if its for something basic like lexopt just for help/version, at least you'd error for unrecognized arguments and can more easily expand it in the future.
-
New alternative for clap (declarative, basic and simple)
Unclear whether it has a solid advantage over other things listed at rust-cli/argparse-benchmarks-rs or whether it's just an "I didn't research what already existed" project.
-
GitHub - epage/parse-benchmarks-rs
I'm tempted to collect all of these benchmark repos into a github org to make them easier to find. So far I know of parser, md, argparse, and template languages.
-
How do i learn about new crates?
Not strictly an answer to your question, but https://github.com/rust-cli/argparse-benchmarks-rs provides a good survey of option parsing crates in Rust.
-
Best cobra alternative for rust.
As others have mentioned clap is one of the more popular, featureful CLI parsers though it does come at a compile time and binary size cost. We are working on improving that. See argparse-benchmarks for by-the-numbers comparison for the different parsers (ie only stats and no full feature lists). Clap is used by ripgrep, cargo, and many other tools
-
Announcing clap_lex 0.1!
Compared to lexopt, which inspired this effort, clap_lex makes some different trade offs for flexibility and ergonomics which allows it to handle every case clap needs. There is room for more ergonomic improvements as the MVP was written for clap's needs. argparse-benchmarks-rs has been updated and clap_lex is roughly in line with lexopt for build-times and binary size.
-
Yet another command line argument parser: bpaf 0.4.0
See https://github.com/rust-cli/argparse-benchmarks-rs/blob/main/examples/bpaf-app/app.rs
-
Immediately off the top of your head what is the best Rust CLI library.
You can use this link: https://github.com/rust-cli/argparse-benchmarks-rs
-
Yet another command line argument parser: bpaf
btw there are the argparse benchmarks which can be interesting points of comparison (though I haven't decided what is the criteria for being added to it yet).
What are some alternatives?
clap-rs - A full featured, fast Command Line Argument Parser for Rust
structopt - Parse command line arguments by defining a struct.
sherlock - 🔎 Hunt down social media accounts by username across social networks
hello-actix - Hello, actix!
ht - Friendly and fast tool for sending HTTP requests
xflags
cli-guidelines - A guide to help you write better command-line programs, taking traditional UNIX principles and updating them for the modern day.
pico-args - An ultra simple CLI arguments parser.
rust-prehistory - historical archive of rust pre-publication development
httpie - 🥧 HTTPie CLI — modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more.