File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -6,13 +6,17 @@ target_sources(nlohmann_json_schema_validator PRIVATE
66 json-patch.cpp
77 string -format-check.cpp
88 )
9+ target_sources (nlohmann_json_schema_validator_cli PRIVATE
10+ cli.cpp)
11+
912target_include_directories (nlohmann_json_schema_validator PUBLIC
1013 $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR} >
1114 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} >
1215 )
13-
1416set_target_properties (nlohmann_json_schema_validator PROPERTIES
1517 PUBLIC_HEADER nlohmann/json-schema.hpp)
18+ target_link_libraries (nlohmann_json_schema_validator_cli PRIVATE
19+ nlohmann_json_schema_validator CLI11::CLI11)
1620
1721# TODO: Why would this need to be if guarded?
1822if (JSON_VALIDATOR_SHARED_LIBS)
Original file line number Diff line number Diff line change 1+ #include < CLI/App.hpp>
2+ #include < CLI/Config.hpp>
3+ #include < CLI/Formatter.hpp>
4+
5+ int main (int argc, char *argv[])
6+ {
7+ CLI::App app{" Json schema validator" , " json-validator" };
8+ // TODO: Move to a generated header file
9+ app.set_version_flag (" --version" , " 2.2.0" );
10+
11+ try {
12+ app.parse (argc, argv);
13+ } catch (const CLI::ParseError &e) {
14+ return app.exit (e);
15+ }
16+ return 0 ;
17+ }
You can’t perform that action at this time.
0 commit comments