Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jbms/argparse
Powerful C++ command-line argument parsing inspired by Python's argparse package
https://github.com/jbms/argparse
Last synced: about 1 month ago
JSON representation
Powerful C++ command-line argument parsing inspired by Python's argparse package
- Host: GitHub
- URL: https://github.com/jbms/argparse
- Owner: jbms
- License: bsl-1.0
- Created: 2015-01-22T22:59:02.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-05-02T21:21:29.000Z (over 2 years ago)
- Last Synced: 2023-03-24T03:22:22.310Z (over 1 year ago)
- Language: Python
- Size: 122 KB
- Stars: 10
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Powerful command-line argument parsing library for C++, inspired by Python's excellent [argparse](https://docs.python.org/3/library/argparse.html) library
This library provides almost all of the functionality of the Python argparse package, and also provides a similar API, albeit with a modern C++ flavor.
The code is licensed under the highly-permissive [Boost Software License](http://www.boost.org/LICENSE_1_0.txt).
# Features:
- Lightweight (single header + single source file, minimal dependencies, limited template use for fast compilation)
- Supports almost all of the functionality of the Python argparse package
- Automatically generates highly-informative help and usage messages
- Handles both optional and positional arguments
- Subparser support, which provides builtin support for git/svn-style sub-commands
- Supports flexible option syntax, including both Unix-style short options (`-o`) and GNU-style long options (`--option`) as accepted by `getopt` and `getopt_long`, as well as other option styles.
- Multiple single-character options that don't take an argument can be specified together, e.g. `-a -r -p` can be specified as `-arp`
- Unique abbreviations of multiple-character options can be used
- A single argument to an option can be specified either as `--long=value` or as `--long value`.# Dependencies:
- Makes use of C++14/C++1y features, and therefore requires GCC >= 4.9 or Clang >= 3.5.
- `std::experimental::optional`
- `std::experimental::string_view`
- [Boost](http://www.boost.org/) >= 1.57
- Boost.Any for storage of parsing results
- Boost.LexicalCast for argument type conversion
- Boost.Core for type printing in error messages