ViralTaco / Argumentative

C++ Command Line Argument Parsing Made Easy.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Argumentative

A simple command line agrument parser for C++.

Getting Started

Prerequisites

Installing

As a library:

Coming soon.

Adding it to your code:

Download vt_argumentative.hpp. Add it to you project. For example in a folder named include.

Include the header to your .cpp file containing you main function.

#include "vt_argumentative.hpp"
// […]
int main(int argc, char** argv) {
  using namespace ive;
  // Define your arguments
  Argumentative app(argc, argv);
  // Use it…
}

Example

For a full example check out example.cpp.

// Includes…
int main(int argc, char** argv) {
  ive::Help help; // default help message.
  ive::Version version("1.0.0");
  ive::Argumentative app(argc, argv, { help, version });

  for (auto const& arg: app) {
    if (arg == version) {
      std::cout << app.version();
    } else {
      std::cout << app.usage();
    }
  }
}

Running the tests

Run ArgumentativeTests

Deployment

This library is in beta. Please avoid using it in production. Or do so at your own discretion.

Contributing

  1. Fork
  2. Code (if you add a feature don't forget to write tests for it)
  3. Test
  4. Add and commit (if possible: each file individually)
  5. Push to your remote
  6. Make a pull request on this repo.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see MIT for more information.

Acknowledgments

About

C++ Command Line Argument Parsing Made Easy.

License:MIT License


Languages

Language:C++ 94.4%Language:CMake 4.3%Language:Shell 1.3%