Skip to content

Commit

Permalink
Remove the canonicalize command from the CLI (#819)
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
  • Loading branch information
jviotti authored Sep 27, 2024
1 parent 43d53dd commit 7b14bda
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 67 deletions.
2 changes: 1 addition & 1 deletion src/cli/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
configure_file(version.h.in version.h @ONLY)
add_executable(sourcemeta_jsonbinpack_cli main.cc commands.h
command_help.cc command_version.cc
command_canonicalize.cc command_compile.cc
command_compile.cc
command_encode.cc command_decode.cc
defaults.h version.h.in)

Expand Down
33 changes: 0 additions & 33 deletions src/cli/command_canonicalize.cc

This file was deleted.

5 changes: 0 additions & 5 deletions src/cli/command_help.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ static const char *USAGE_DETAILS = R"EOF(
help Print this help information and quit.
canonicalize [schema.json] Canonicalize a given JSON Schema definition
and print the result to stdout. If a path to
a schema is not provided, the schema will
be read from standard input.
compile [schema.json] Compile a given JSON Schema definition
into an encoding schema and print the result to
stdout. If a path to a schema is not provided,
Expand Down
2 changes: 0 additions & 2 deletions src/cli/commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
namespace sourcemeta::jsonbinpack::cli {
auto help(const std::string &program) -> int;
auto version() -> int;
auto canonicalize(const std::filesystem::path &schema_path) -> int;
auto canonicalize() -> int;
auto compile(const std::filesystem::path &schema_path) -> int;
auto compile() -> int;
auto encode(const std::filesystem::path &schema_path,
Expand Down
9 changes: 0 additions & 9 deletions src/cli/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ static auto cli_main(const std::string &program, const std::string &command,
return sourcemeta::jsonbinpack::cli::version();
}

if (command == "canonicalize") {
if (arguments.empty()) {
return sourcemeta::jsonbinpack::cli::canonicalize();
}

assert_arguments(command, arguments, 1);
return sourcemeta::jsonbinpack::cli::canonicalize(arguments.at(0));
}

if (command == "compile") {
if (arguments.empty()) {
return sourcemeta::jsonbinpack::cli::compile();
Expand Down
13 changes: 0 additions & 13 deletions test/cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,6 @@ add_test(NAME cli.unknown
COMMAND "${RUNNER_BIN}"
"${JSONBINPACK_CLI_PATH}" 1 "Unknown command" foobarbaz)

add_test(NAME cli.canonicalize_file
COMMAND "${RUNNER_BIN}"
"${JSONBINPACK_CLI_PATH}" 0 "\"enum\":"
canonicalize "${CMAKE_CURRENT_SOURCE_DIR}/schema_boolean.json")

add_test(NAME cli.canonicalize_stdin
COMMAND "${RUNNER_STDIN_BIN}"
"${CMAKE_CURRENT_SOURCE_DIR}/schema_boolean.json"
"${JSONBINPACK_CLI_PATH}" 0 "\"enum\":"
canonicalize)

add_test(NAME cli.compile_file
COMMAND "${RUNNER_BIN}"
"${JSONBINPACK_CLI_PATH}" 0 "BOUNDED_MULTIPLE_8BITS_ENUM_FIXED"
Expand All @@ -58,8 +47,6 @@ if(WIN32)
cli.default
cli.help
cli.unknown
cli.canonicalize_file
cli.canonicalize_stdin
cli.compile_file
cli.compile_stdin
PROPERTIES RUN_SERIAL TRUE)
Expand Down
4 changes: 0 additions & 4 deletions test/cli/schema_boolean.json

This file was deleted.

0 comments on commit 7b14bda

Please sign in to comment.