Skip to content

Commit

Permalink
Update convert_example.cc to allow for one argument for the "dump" fo…
Browse files Browse the repository at this point in the history
…rmat.
  • Loading branch information
Andrii Verbytskyi committed Aug 30, 2024
1 parent 17d89b8 commit 6a24676
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions examples/ConvertExample/convert_example.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string,formats> format_map;
Expand Down

0 comments on commit 6a24676

Please sign in to comment.