You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -64,7 +64,7 @@ Features that were added in the last released major version are marked with "
64
64
### Introduction
65
65
66
66
CLI11 provides all the features you expect in a powerful command line parser, with a beautiful, minimal syntax and no dependencies beyond C++11. It is header only, and comes in a single file form for easy inclusion in projects. It is easy to use for small projects, but powerful enough for complex command line projects, and can be customized for frameworks.
67
-
It is tested on [Travis][], [AppVeyor][], [Azure][], and [GitHub Actions][actions-link], and is used by the [GooFit GPU fitting framework][goofit]. It was inspired by [`plumbum.cli`][plumbum] for Python. CLI11 has a user friendly introduction in this README, a more in-depth tutorial [GitBook][], as well as [API documentation][api-docs] generated by Travis.
67
+
It is tested on [Azure][] and [GitHub Actions][actions-link], and was originally used by the [GooFit GPU fitting framework][goofit]. It was inspired by [`plumbum.cli`][plumbum] for Python. CLI11 has a user friendly introduction in this README, a more in-depth tutorial [GitBook][], as well as [API documentation][api-docs] generated by Travis.
68
68
See the [changelog](./CHANGELOG.md) or [GitHub Releases][] for details for current and past releases. Also see the [Version 1.0 post][], [Version 1.3 post][], [Version 1.6 post][], or [Version 2.0 post][] for more information.
69
69
70
70
You can be notified when new releases are made by subscribing to <https://github.com/CLIUtils/CLI11/releases.atom> on an RSS reader, like Feedly, or use the releases mode of the GitHub watching tool.
@@ -77,7 +77,7 @@ An acceptable CLI parser library should be all of the following:
77
77
* Short, simple syntax: This is one of the main reasons to use a CLI parser, it should make variables from the command line nearly as easy to define as any other variables. If most of your program is hidden in CLI parsing, this is a problem for readability.
78
78
* C++11 or better: Should work with GCC 4.8+ (default on CentOS/RHEL 7), Clang 3.4+, AppleClang 7+, NVCC 7.0+, or MSVC 2015+.
79
79
* Work on Linux, macOS, and Windows.
80
-
* Well tested using [Travis][] (Linux) and [AppVeyor][] (Windows) or [Azure][] (all three). "Well" is defined as having good coverage measured by [CodeCov][].
80
+
* Well tested on all common platforms and compilers. "Well" is defined as having good coverage measured by [CodeCov][].
81
81
* Clear help printing.
82
82
* Nice error messages.
83
83
* Standard shell idioms supported naturally, like grouping flags, a positional separator, etc.
@@ -128,7 +128,7 @@ So, this library was designed to provide a great syntax, good compiler compatibi
128
128
There are some other possible "features" that are intentionally not supported by this library:
129
129
130
130
* Non-standard variations on syntax, like `-long` options. This is non-standard and should be avoided, so that is enforced by this library.
131
-
* Completion of partial options, such as Python's `argparse` supplies for incomplete arguments. It's better not to guess. Most third party command line parsers for python actually reimplement command line parsing rather than using argparse because of this perceived design flaw.
131
+
* Completion of partial options, such as Python's `argparse` supplies for incomplete arguments. It's better not to guess. Most third party command line parsers for python actually reimplement command line parsing rather than using argparse because of this perceived design flaw (recent versions do have an option to disable it).
132
132
* Autocomplete: This might eventually be added to both Plumbum and CLI11, but it is not supported yet.
133
133
* Wide strings / unicode: Since this uses the standard library only, it might be hard to properly implement, but I would be open to suggestions in how to do this.
134
134
@@ -139,7 +139,7 @@ To use, there are several methods:
139
139
* All-in-one local header: Copy `CLI11.hpp` from the [most recent release][github releases] into your include directory, and you are set. This is combined from the source files for every release. This includes the entire command parser library, but does not include separate utilities (like `Timer`, `AutoTimer`). The utilities are completely self contained and can be copied separately.
140
140
* All-in-one global header: Like above, but copying the file to a shared folder location like `/opt/CLI11`. Then, the C++ include path has to be extended to point at this folder. With CMake, use `include_directories(/opt/CLI11)`
141
141
* Local headers and target: Use `CLI/*.hpp` files. You could check out the repository as a git submodule, for example. With CMake, you can use `add_subdirectory` and the `CLI11::CLI11` interface target when linking. If not using a submodule, you must ensure that the copied files are located inside the same tree directory than your current project, to prevent an error with CMake and `add_subdirectory`.
142
-
* Global headers: Use `CLI/*.hpp` files stored in a shared folder. You could check out the git repository in a system-wide folder, for example `/opt/`. With CMake, you could add to the include path via:
142
+
* Global headers: Use `CLI/*.hpp` files stored in a shared folder. You could check out the git repository to a system-wide folder, for example `/opt/`. With CMake, you could add to the include path via:
143
143
144
144
```bash
145
145
if(NOT DEFINED CLI11_DIR)
@@ -159,15 +159,27 @@ And then in the source code (adding several headers might be needed to prevent l
159
159
* Global headers and target: configuring and installing the project is required for linking CLI11 to your project in the same way as you would do with any other external library. With CMake, this step allows using `find_package(CLI11 CONFIG REQUIRED)` and then using the `CLI11::CLI11` target when linking. If `CMAKE_INSTALL_PREFIX` was changed during install to a specific folder like `/opt/CLI11`, then you have to pass `-DCLI11_DIR=/opt/CLI11` when building your current project. You can also use [Conan.io][conan-link] or [Hunter][].
160
160
(These are just conveniences to allow you to use your favorite method of managing packages; it's just header only so including the correct path and
161
161
using C++11 is all you really need.)
162
+
* Via FetchContent in CMake 3.14+ (or 3.11+ with more work): you can add this with fetch-content, then use the `CLI11::CLI11` target as above, and CMake will download the project in the configure stage:
It is highly recommended that you use the git hash for `GIT_TAG` instead of a tag or branch, as that will both be more secure, as well as faster to reconfigure - CMake will not have to reach out to the internet to see if the tag moved. You can also download just the single header file from the releases using `file(DOWNLOAD`.
162
176
163
177
To build the tests, checkout the repository and use CMake:
164
178
165
179
```bash
166
-
mkdir build
167
-
cd build
168
-
cmake ..
169
-
make
170
-
GTEST_COLOR=1 CTEST_OUTPUT_ON_FAILURE=1 make test
180
+
cmake -S . -B build
181
+
cmake --build build
182
+
CTEST_OUTPUT_ON_FAILURE=1 cmake --build build -t test
171
183
```
172
184
173
185
<details><summary>Note: Special instructions for GCC 8</summary><p>
@@ -1010,12 +1022,10 @@ CLI11 was developed at the [University of Cincinnati][] to support of the [GooFi
0 commit comments