mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-05-01 05:03:52 +00:00
Adding a error if json requested but missing
This commit is contained in:
parent
4974afb49d
commit
4ddab334af
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
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.
|
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.
|
||||||
It is tested on [Travis] and [AppVeyor], and is being included in 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.
|
It is tested on [Travis] and [AppVeyor], and is being included in 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.
|
||||||
See the [changelog](./CHANGELOG.md) or [GitHub Releases] for details for current and past releases. Also see the [Version 1.0 post] and [Version 1.3 post] for more information.
|
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], or [[Version 1.6 post] for more information.
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
@ -462,6 +462,7 @@ CLI11 was developed at the [University of Cincinnati] to support of the [GooFit]
|
|||||||
[Clara]: https://github.com/philsquared/Clara
|
[Clara]: https://github.com/philsquared/Clara
|
||||||
[Version 1.0 post]: https://iscinumpy.gitlab.io/post/announcing-cli11-10/
|
[Version 1.0 post]: https://iscinumpy.gitlab.io/post/announcing-cli11-10/
|
||||||
[Version 1.3 post]: https://iscinumpy.gitlab.io/post/announcing-cli11-13/
|
[Version 1.3 post]: https://iscinumpy.gitlab.io/post/announcing-cli11-13/
|
||||||
|
[Version 1.6 post]: https://iscinumpy.gitlab.io/post/announcing-cli11-16/
|
||||||
[wandbox-badge]: https://img.shields.io/badge/try-online-blue.svg
|
[wandbox-badge]: https://img.shields.io/badge/try-online-blue.svg
|
||||||
[wandbox-link]: https://wandbox.org/permlink/Z4uwGhnhD2wm2r7Z
|
[wandbox-link]: https://wandbox.org/permlink/Z4uwGhnhD2wm2r7Z
|
||||||
[releases-badge]: https://img.shields.io/github/release/CLIUtils/CLI11.svg
|
[releases-badge]: https://img.shields.io/github/release/CLIUtils/CLI11.svg
|
||||||
|
@ -16,11 +16,14 @@ endfunction()
|
|||||||
|
|
||||||
option(CLI11_EXAMPLE_JSON OFF)
|
option(CLI11_EXAMPLE_JSON OFF)
|
||||||
if(CLI11_EXAMPLE_JSON)
|
if(CLI11_EXAMPLE_JSON)
|
||||||
|
if(NOT EXISTS "${CLI11_SOURCE_DIR}/extern/json/single_include/nlohmann/json.hpp")
|
||||||
|
message(ERROR "You are missing the json package for CLI11_EXAMPLE_JSON. Please update your submodules (git submodule update --init)")
|
||||||
|
endif()
|
||||||
if(CMAKE_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
|
if(CMAKE_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
|
||||||
message(WARNING "The json example requires GCC 4.9+ (requirement on json library)")
|
message(WARNING "The json example requires GCC 4.9+ (requirement on json library)")
|
||||||
endif()
|
endif()
|
||||||
add_cli_exe(json json.cpp)
|
add_cli_exe(json json.cpp)
|
||||||
target_include_directories(json PUBLIC SYSTEM ../extern/json/single_include)
|
target_include_directories(json PUBLIC SYSTEM "${CLI11_SOURCE_DIR}/extern/json/single_include")
|
||||||
|
|
||||||
add_test(NAME json_config_out COMMAND json --item 2)
|
add_test(NAME json_config_out COMMAND json --item 2)
|
||||||
set_property(TEST json_config_out PROPERTY PASS_REGULAR_EXPRESSION
|
set_property(TEST json_config_out PROPERTY PASS_REGULAR_EXPRESSION
|
||||||
|
Loading…
x
Reference in New Issue
Block a user