Skip to content

DimitrijeDobrota/poafloc

Poafloc

Command-line argument parser for C and C++ written in C++20

Description

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.

Dependencies

  • CMake 3.14 or latter
  • Compiler with C++20 support (tested on clang version 19.1.7)

Building and installing

See the BUILDING document.

Usage

Please reference example folder for relevant usage examples.

Help

Refer to GNU argp documentation

Version History

  • 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

Contributing

See the CONTRIBUTING document.

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

Inspiration, code snippets, etc.

About

Parser Of Arguments For Lines Of Commands

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors