<p align="center" <img height="100" src="https://i.imgur.com/oDXeMUQ.png" alt="argparse"/ </p
<p align="center" <a href="https://github.com/p-ranav/argparse/blob/master/LICENSE" <img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="license"/ </a <img src="https://img.shields.io/badge/version-3.2-blue.svg?cacheSeconds=2592000" alt="version"/ </p
Highlights
- Single header file
- Requires C++17
- MIT License
Table of Contents
- Quick Start
- Positional Arguments
- Optional Arguments
- Requiring optional arguments
- Accessing optional arguments without default values
- Deciding if the value was given by the user
- Joining values of repeated optional arguments
- Repeating an argument to increase a value
- Mutually Exclusive Group
- Storing values into variables
- Negative Numbers
- Combining Positional and Optional Arguments
- Printing Help
- Adding a description and an epilog to help
- List of Arguments
- Compound Arguments
- Converting to Numeric Types
- Default Arguments
- Gathering Remaining Arguments
- Parent Parsers
- Subcommands
- Getting Argument and Subparser Instances
- Parse Known Args
- Hidden argument and alias
- ArgumentParser in bool Context
- Custom Prefix Characters
- Custom Assignment Characters
- Further Examples
- Construct a JSON object from a filename argument
- Positional Arguments with Compound Toggle Arguments
- Restricting the set of values for an argument
- Using option=value syntax
- Advanced usage formatting
- Developer Notes
- Copying and Moving
- CMake Integration
- Building, Installing, and Testing
- Supported Toolchains
- Contributing
- License
Quick Start
Simply include argparse.hpp and you're good to go.
#include <argparse/argparse.hpp>To start parsing command-line arguments, create an ArgumentParser.
argparse::ArgumentParser program("program_name");NOTE: There is an optional second argument to the ArgumentParser which is the program version. Example: argparse::ArgumentParser program("libfoo", "1.9.0");