Is 'structopt' a common name for this type of argument parser library? I thought it started with the Rust library of the same name but no one has mentioned it yet...<p>In my opinion, it is _the_ way to quickly create a quality CLI.<p><a href="https://github.com/TeXitoi/structopt" rel="nofollow">https://github.com/TeXitoi/structopt</a>
Similar lib I made for Python: <a href="https://pypi.org/project/func-argparse/" rel="nofollow">https://pypi.org/project/func-argparse/</a><p>The nice thing with Python is that I implemented a parser from a function signature, and it also works for NamedTuple.<p>The advantage wrt to other python parser is that it uses the type annotations, instead of guessing
I will try this one out. Here’s a similar library that I’ve had success with before: <a href="https://github.com/mmahnic/argumentum" rel="nofollow">https://github.com/mmahnic/argumentum</a>
I’ve also recently used <a href="https://docs.opencv.org/trunk/d0/d2e/classcv_1_1CommandLineParser.html#details" rel="nofollow">https://docs.opencv.org/trunk/d0/d2e/classcv_1_1CommandLineP...</a> from OpenCV. It’s useful when you’re already using OpenCV and don’t want to bring in another dependency.
> Include <structopt/app.hpp> and you're good to go.<p>I haven't touched C++ for almost a decade but I assume there's (still?) no obvious way that always works to include a dependency package in your build?<p>For you C++ devs, does this instruction make it obvious how to install this thing into your project?
This seems to support git-like subcommands. Very, very nice: something mostly missing from other option parsers.<p>Now does it generate the synopsis part of a man page automatically?
This looks cool but c++17 is required (as far as I can tell, since it requires std::optional), so it's difficult to use for many things until all my colleagues (and their clusters) upgrade their compilers.
A nice way to declare command line options and arguments. I expected already templates, but some of the generated code looks strange:<p>static VISIT_STRUCT_CONSTEXPR const int max_visitable_members = 69;
<a href="https://github.com/p-ranav/structopt/blob/master/single_include/structopt/structopt.hpp#L270" rel="nofollow">https://github.com/p-ranav/structopt/blob/master/single_incl...</a>
I've used <a href="http://docopt.org/" rel="nofollow">http://docopt.org/</a> in the past for a toy project.<p>It's an interesting concept where you define the command line "help" syntax and it generates an arguments structure and an associated parser. I've used the C version, I believe the C++ version is better maintained.