https://github.com/yashkumarverma/argument-parser-cpp
a simple argument parser in c++
https://github.com/yashkumarverma/argument-parser-cpp
argument cli cpp parser
Last synced: 12 months ago
JSON representation
a simple argument parser in c++
- Host: GitHub
- URL: https://github.com/yashkumarverma/argument-parser-cpp
- Owner: YashKumarVerma
- Created: 2020-03-05T20:43:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-13T02:40:13.000Z (over 6 years ago)
- Last Synced: 2025-02-09T15:14:17.140Z (over 1 year ago)
- Topics: argument, cli, cpp, parser
- Language: C++
- Size: 91.8 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Argument Parser C++
a miniature argument parser for c++
### Installation
- Intended to be used with the [cpp template](https://github.com/YashKumarVerma/cpp-template) as a pluggable module.
- Simply copy the `includes/parser` directory to your cpp project built using the **_cpp template_**
### Usage
- Load the module using `#include"./../includes/parser/parser.h"` in your `app.cpp` file.
- Access the number of arguments, and character array with arguments using `int main(int argc, char* argv[])`
- Create a parser instance, and feed it the `argc` and `argv` values `Parser parser(argc, argv);`
- Now check if a handle is passed or not using the `parser.has("handle")` method
- To get the value of a handle, use `parser.val("handle")` method
### Sample
- Sample code for demonstration is available in [`app.js`](../master/source/app.cpp)

---
**Author**: [Yash Kumar Verma](http://github.com/yashkumarverma)