clap README

The project's README from github.com/clap-rs/clap. As one markdown file: README.md.

clap

Command Line Argument Parser for Rust

Crates.io Crates.io License License Build Status Coverage Status Contributors

Dual-licensed under Apache 2.0 or MIT.

Get Started

$ cargo add clap

About

Create your command-line parser, with all of the bells and whistles, declaratively or procedurally.

For more details, see:

Sponsors

Gold

Silver

Bronze

Backer

clap (clap-rs/clap)

Searching Database…

16.8K ·GitHub
What is this?clap is a full-featured, fast command-line argument parser for Rust, letting you build CLIs with flags, options, positional arguments, and subcommands, plus auto-generated help and usage text.
Is this a library I add to my code, or a standalone app?It is a Rust library (crate): you pull it in as a dependency and build your own command-line parser with it, either declaratively with derive macros on a struct or procedurally with a builder API.
How do I add it to my Rust project?Add clap as a dependency in Cargo.toml (for example with cargo add clap), then define your CLI either by deriving from a struct or by building it with the procedural builder API; full usage details and examples are linked from the README.
Does clap handle subcommands and positional arguments out of the box?Yes, the project's own topics list argument-parsing, positional-arguments, parsed-arguments and subcommands as core capabilities alongside the main parser.
Where do I find full docs and usage examples?The README points to docs.rs for the API reference and to an examples section in the repository for sample CLI implementations.
Should I use the derive macro or the builder API?Both are first-class options: derive lets you define a CLI declaratively from a struct's fields, while the builder API lets you construct the same parser procedurally in code; pick whichever fits your style.
What are similar projects?mitex, cobra, liteparse, fx, commander.js, hexyl, ast-grep, dust
Creator
clap-rs
Size
20.3 MB
Stars
16.8K
Age
11y
Commits · 90 Days