https://github.com/clap-rs/thunder
⚡ Zero-boilerplate commandline argument parsing in Rust
https://github.com/clap-rs/thunder
argument-parsing cli-app rust
Last synced: 11 months ago
JSON representation
⚡ Zero-boilerplate commandline argument parsing in Rust
- Host: GitHub
- URL: https://github.com/clap-rs/thunder
- Owner: clap-rs
- Archived: true
- Created: 2018-03-27T20:31:07.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-24T20:25:49.000Z (over 7 years ago)
- Last Synced: 2024-04-14T00:35:03.484Z (almost 2 years ago)
- Topics: argument-parsing, cli-app, rust
- Language: Rust
- Homepage:
- Size: 46.9 KB
- Stars: 361
- Watchers: 11
- Forks: 7
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://travis-ci.org/spacekookie/thunder/)
[](https://ci.appveyor.com/project/spacekookie/thunder)
[](https://crates.io/crates/thunder)
[](https://docs.rs/thunder/)
Write simple commandline applications in Rust with *zero* boilerplate. Bind Rust functions to CLI functions and options with macros. This crate uses [clap.rs](https://github.com/kbknapp/clap-rs) for the actual argument parsing.
## Example
```rust,norun
// ... ignore the imports for now ...
struct MyApp;
/// Describe your application with style ✨
#[thunderclap]
impl MyApp {
/// Say hello to someone
fn hello(name: &str) {
println!("Hello {}", name);
}
}
fn main() {
MyApp::start();
}
```
**This prints**
```norun
USAGE:
MyApp [SUBCOMMAND]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
SUBCOMMANDS:
hello Say hello to someone
help Prints this message or the help of the given subcommand(s)
```
Check the documentation for more examples.