#argument #cli #arg #parser #parse

archived nightly macro thunder

Create simple commandline apps with *zero* boilerplate!

6 releases

Uses old Rust 2015

0.3.1 May 16, 2018
0.3.0 May 16, 2018
0.2.0 May 15, 2018
0.1.2 Apr 4, 2018
0.1.1 Mar 30, 2018

#25 in #argument-parsing

29 downloads per month

MIT/X11 OR Apache-2.0

20KB
338 lines

⚡ Thunder ⚡

Build status Docs.rs

Write simple commandline applications in Rust with zero boilerplate. Bind Rust functions to CLI functions and options with macros. This crate uses clap.rs for the actual argument parsing.

Example

// ... 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

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.

Dependencies

~2MB
~50K SLoC