About

clap or Command Line Argument Parser

Is a simple-to-use, efficient, and fully-configurable library for parsing command line arguments.

clap supports advanced features like argument relationships, subcommands, and much, much more.

A Quick Taste

The following Rust code is all it takes to get started:

use clap::App; 

fn main() { 
    App::new("myapp")
       .version("1.0")
       .about("Does great things!")
       .author("Kevin K.")
       .get_matches(); 
}

If the user runs $ myapp --help the following would be printed

$ myapp --help
myapp 1.0 
Kevin K. 
Does great things! 

USAGE: 
    myapp [FLAGS] 

FLAGS: 
    -h, --help Prints this message 
    -V, --version Prints version information

Features

Fast

Configurable

Standards

Completions

Spend time building your application

Why use clap

Automatic Help
clap generates your help message and usage strings for you automatically from the list of valid argu...
Friendly Errors
clap generates friendly, and informative error messages that inform the end user of exact problem, w...
Intuitive
clap is extremely easy and intuitive to use. All you may need is a code completer!
Relationships
Arguments can have complex relationships easily, and intuitively. There can be requirements, conflic...
Suggestions
If the user makes a typo, clap will gently suggest a correction based on the current context
YAML Support
You can define your list of valid arguments in a YAML file, keeping your code clean and tidy

OUR numbers

99
Github Stars
99
Downloads
99
used by open source projects
99
Amazing contributors

Our sponsors

Latest blogs

Tuning Weightloss and Performance
January 27, 2019
This is a follow up from my previous post. In that post, I conjectured that turning on LTO (Link Time Optimization) and increasing the optimization levels would...
New Years Weightloss
January 24, 2019
Preface: This post is somewhat hard to write, because it contains code that I’m not proud of, it’s messy…bloated…it’s real. I’m exposing something, in a project

Contact Us