From 6a246762f612e1d0e41fcd06fcb125edbbcc6fb7 Mon Sep 17 00:00:00 2001 From: Andrii Verbytskyi Date: Fri, 30 Aug 2024 10:36:44 +0200 Subject: [PATCH] Update convert_example.cc to allow for one argument for the "dump" format. --- examples/ConvertExample/convert_example.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/ConvertExample/convert_example.cc b/examples/ConvertExample/convert_example.cc index 31d7ee87..71f1b5b6 100644 --- a/examples/ConvertExample/convert_example.cc +++ b/examples/ConvertExample/convert_example.cc @@ -83,10 +83,14 @@ int main(int argc, char** argv) if (cmdline_parser (argc, argv, &ai) != 0) { exit(1); } - if ( !( ( ai.inputs_num == 2 && ( std::string(ai.output_format_arg) != "none" )) || ( ai.inputs_num == 1 && ( std::string(ai.output_format_arg) == "none") ) ) ) + if ( !( + ( ai.inputs_num == 2 && ( std::string(ai.output_format_arg) != "none" && std::string(ai.output_format_arg) != "dump" )) || + ( ai.inputs_num == 1 && ( std::string(ai.output_format_arg) == "none" || std::string(ai.output_format_arg) == "dump" )) + ) + ) { - printf("Exactly two arguments are requred: the name of input and output files if the output format in not \"none\"\n"); - printf("In case the output format is \"none\" exactly one argument should be given: the name of input file.\n"); + printf("Exactly two arguments are requred: the name of input and output files if the output format in not \"none\" or \"dump\" \n"); + printf("In case the output format is \"none\" or \"dump\" exactly one argument should be given: the name of input file.\n"); exit(1); } std::map format_map;