Command-line argument parser for C and C++ written in C++20
This project is heavily inspired by GNU argp and the initial goal was to have a drop in replacement. I've managed to implement most of the features I plan on using, but there is still space for future improvements, maybe even in other directions.
The main motivation behind this project is gaining an in depth understanding of all of the syntax rules of command line arguments, to be used for all of the UNIX utilities.
This project included a few challenges in both the design and implementation. There was a lot of experimentation with interface that works for both C and C++, as well as having a single library that provides bindings and works with both languages simultaneously. There were a lot of caveats and edge cases to be understood first, and later implemented.
- CMake 3.14 or latter
- Compiler with C++20 support (tested on clang version 19.1.7)
See the BUILDING document.
Please reference example folder for relevant usage examples.
Refer to GNU argp documentation
- 2.0
- Reinvent with modern C++ features
- Structure bindings
- Exception based error handling
- 1.2
- Propagate parser generated error
- 1.1
- Modernize CMake project
- Modernize codebase
- Add test suite
- 1.0
- Initial Release
See the CONTRIBUTING document.
This project is licensed under the MIT License - see the LICENSE file for details
Inspiration, code snippets, etc.