1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-05-03 22:13:51 +00:00

Adding a couple of extra libraries.

This commit is contained in:
Henry Schreiner 2017-06-02 19:42:05 -04:00 committed by GitHub
parent 2c15786bca
commit bfeadf8764

View File

@ -33,14 +33,23 @@ An acceptable CLI parser library should be all of the following:
The major CLI parsers for C++ include (with my biased opinions): The major CLI parsers for C++ include (with my biased opinions):
* [Boost Program Options]: A great library if you already depend on Boost, but its pre-C++11 syntax is really odd and setting up the correct call in the main function is poorly documented (and is nearly a page of code). A simple wrapper for the Boost library was originally developed, but was discarded as CLI11 became more powerful. The idea of capturing a value and setting it originated with Boost PO. | Library | My biased opinion |
* [The Lean Mean C++ Option Parser]: One header file is great, but the syntax is atrocious, in my opinion. It was quite impractical to wrap the syntax or to use in a complex project. It seems to handle standard parsing quite well. |---------|-------------------|
* [TCLAP]: The not-quite-standard command line parsing causes common shortcuts to fail. It also seems to be poorly supported, with only minimal bugfixes accepted. Header only, but in quite a few files. Has not managed to get enough support to move to GitHub yet. No subcommands. Produces wrapped values. | [Boost Program Options] | A great library if you already depend on Boost, but its pre-C++11 syntax is really odd and setting up the correct call in the main function is poorly documented (and is nearly a page of code). A simple wrapper for the Boost library was originally developed, but was discarded as CLI11 became more powerful. The idea of capturing a value and setting it originated with Boost PO. |
* [Cxxopts]: C++11, single file, and nice CMake support, but requires regex, therefore GCC 4.8 (CentOS 7 default) does not work. Syntax closely based on Boost PO, so not ideal but familiar. | [The Lean Mean C++ Option Parser] | One header file is great, but the syntax is atrocious, in my opinion. It was quite impractical to wrap the syntax or to use in a complex project. It seems to handle standard parsing quite well. |
* [DocOpt]: Completely different approach to program options in C++11, you write the docs and the interface is generated. Too fragile and specialized. | [TCLAP] | The not-quite-standard command line parsing causes common shortcuts to fail. It also seems to be poorly supported, with only minimal bugfixes accepted. Header only, but in quite a few files. Has not managed to get enough support to move to GitHub yet. No subcommands. Produces wrapped values. |
* [GFlags]: The Google Commandline Flags library. Uses macros heavily, and is limited in scope, missing things like subcommands. It provides a simple syntax and supports config files/env vars. | [Cxxopts] | C++11, single file, and nice CMake support, but requires regex, therefore GCC 4.8 (CentOS 7 default) does not work. Syntax closely based on Boost PO, so not ideal but familiar. |
* [GetOpt]: Very limited C solution with long, convoluted syntax. Does not support much of anything, like help generation. Always available on UNIX, though (but in different flavors). | [DocOpt] | Completely different approach to program options in C++11, you write the docs and the interface is generated. Too fragile and specialized. |
* [ProgramOptions.hxx]: Intresting library, less powerful and no subcommands.
After I wrote this, I also found the following libraries:
| Library | My biased opinion |
|---------|-------------------|
| [GFlags] | The Google Commandline Flags library. Uses macros heavily, and is limited in scope, missing things like subcommands. It provides a simple syntax and supports config files/env vars. |
| [GetOpt] | Very limited C solution with long, convoluted syntax. Does not support much of anything, like help generation. Always available on UNIX, though (but in different flavors). |
| [ProgramOptions.hxx] | Intresting library, less powerful and no subcommands. |
| [Args] | Also interesting, and supports subcommands. I like the optional-like design, but CLI11 is cleaner and provides direct value access, and is less verbose. |
| [Argument Aggregator] | I'm a big fan of the [fmt] library, and the try-catch statement looks familiar. :thumbsup: Doesn't seem to support subcommands. |
None of these libraries fulfill all the above requirements. As you probably have already guessed, CLI11 does. None of these libraries fulfill all the above requirements. As you probably have already guessed, CLI11 does.
So, this library was designed to provide a great syntax, good compiler compatibility, and minimal installation fuss. So, this library was designed to provide a great syntax, good compiler compatibility, and minimal installation fuss.
@ -309,3 +318,6 @@ CLI11 was developed at the [University of Cincinnati] to support of the [GooFit]
[University of Cincinnati]: http://www.uc.edu [University of Cincinnati]: http://www.uc.edu
[GitBook]: https://henryiii.gitbooks.io/cli11/content [GitBook]: https://henryiii.gitbooks.io/cli11/content
[ProgramOptions.hxx]: https://github.com/Fytch/ProgramOptions.hxx [ProgramOptions.hxx]: https://github.com/Fytch/ProgramOptions.hxx
[Argument Aggregator]: https://github.com/vietjtnguyen/argagg
[Args]: https://github.com/Taywee/args
[fmt]: https://github.com/fmtlib/fmt