Skip to content
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.
/ thunder Public archive

⚡ Zero-boilerplate commandline argument parsing in Rust

Notifications You must be signed in to change notification settings

clap-rs/thunder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

⚡ Zero-boilerplate commandline argument parsing in Rust

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages