improve readme
This commit is contained in:
42
README.md
42
README.md
@@ -3,31 +3,16 @@
|
|||||||
[](https://travis-ci.com/cwpearson/argparse)
|
[](https://travis-ci.com/cwpearson/argparse)
|
||||||
|
|
||||||
Simple single-file header-only CLI option parsing for C++.
|
Simple single-file header-only CLI option parsing for C++.
|
||||||
No subcommands or grouped commands.
|
* No std::regex
|
||||||
Only supports `-s value`/`--long-option value` style for options.
|
* No subcommands or grouped commands.
|
||||||
Only supports `--long-flag` style for flags.
|
* Only supports `-s value`/`--long-option value` style for options.
|
||||||
|
* Only supports `--long-flag` style for flags.
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
Download the latest [`argparse.hpp`](www.google.com) and include it in your project.
|
Download the latest [`argparse.hpp`](www.google.com) and include it in your project.
|
||||||
|
|
||||||
## Features
|
## Example
|
||||||
|
|
||||||
- [x] allow (default) / disallow (`Parser::no_unrecognize()`) unrecognized options and flags
|
|
||||||
- [x] optional/required (`PosnlBase::required()`) positional arguments
|
|
||||||
- [x] flags with `-s`, `--long-flag` formats
|
|
||||||
- [x] options with `--long-opt val` format
|
|
||||||
- [x] positional arguments
|
|
||||||
- [x] `--` to stop parsing options and flags
|
|
||||||
- [x] modify `argc`/`argv` (disable with `Parser::no_consume()`)
|
|
||||||
- Option/Positional Argument Types
|
|
||||||
- [x] `int`
|
|
||||||
- [x] `size_t`
|
|
||||||
- [x] `float`
|
|
||||||
- [x] `double`
|
|
||||||
- [x] `std::string`
|
|
||||||
|
|
||||||
## Examples
|
|
||||||
|
|
||||||
```c++
|
```c++
|
||||||
#include "argparse/argparse.hpp"
|
#include "argparse/argparse.hpp"
|
||||||
@@ -77,6 +62,23 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- [x] Does not require `std::regex`
|
||||||
|
- [x] allow (default) / disallow (`Parser::no_unrecognize()`) unrecognized options and flags
|
||||||
|
- [x] optional/required (`PosnlBase::required()`) positional arguments
|
||||||
|
- [x] flags with `-s`, `--long-flag` formats
|
||||||
|
- [x] options with `--long-opt val` format
|
||||||
|
- [x] positional arguments
|
||||||
|
- [x] `--` to stop parsing options and flags
|
||||||
|
- [x] modify `argc`/`argv` (disable with `Parser::no_consume()`)
|
||||||
|
- Option/Positional Argument Types
|
||||||
|
- [x] `int`
|
||||||
|
- [x] `size_t`
|
||||||
|
- [x] `float`
|
||||||
|
- [x] `double`
|
||||||
|
- [x] `std::string`
|
||||||
|
|
||||||
## Roadmap
|
## Roadmap
|
||||||
|
|
||||||
- [ ] Reject duplicate flags / options
|
- [ ] Reject duplicate flags / options
|
||||||
|
Reference in New Issue
Block a user