diff --git a/CHANGELOG.md b/CHANGELOG.md index e3707ef4c3be22719d2a64f00e5703b86c8e446b..2b5b5a86d77e61de6ee1b2cf15b1fe1376b850c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. ## [Unreleased] ### Added -- add --binary option for read and write files in binary format +- add -b or --binary option for read and write files in binary format - add cross compile file for sparc - add tests for the compression entity - add test for cmp_rdcu_cfg.c diff --git a/cmp_tool.c b/cmp_tool.c index f30969929bed398958a45ad5339c87ea6181e83b..847100fc3e7e5955271d5d7891fd0ef4f7eb1118 100644 --- a/cmp_tool.c +++ b/cmp_tool.c @@ -73,7 +73,6 @@ enum { NO_HEADER, MODEL_ID, MODEL_COUTER, - BINARY_IO, }; static const struct option long_options[] = { @@ -90,7 +89,7 @@ static const struct option long_options[] = { {"no_header", no_argument, NULL, NO_HEADER}, {"model_id", required_argument, NULL, MODEL_ID}, {"model_counter", required_argument, NULL, MODEL_COUTER}, - {"binary", no_argument, NULL, BINARY_IO}, + {"binary", no_argument, NULL, 'b'}, {NULL, 0, NULL, 0} }; @@ -165,12 +164,15 @@ int main(int argc, char **argv) exit(EXIT_FAILURE); } - while ((opt = getopt_long(argc, argv, "ac:d:hi:m:no:vV", long_options, + while ((opt = getopt_long(argc, argv, "abc:d:hi:m:no:vV", long_options, NULL)) != -1) { switch (opt) { case 'a': /* --rdcu_par */ add_rdcu_pars = 1; break; + case 'b': + io_flags |= CMP_IO_BINARY; + break; case 'c': cmp_operation = 1; cfg_file_name = optarg; @@ -233,9 +235,6 @@ int main(int argc, char **argv) case MODEL_COUTER: model_counter_str = optarg; break; - case BINARY_IO: - io_flags |= CMP_IO_BINARY; - break; default: print_help(program_name); exit(EXIT_FAILURE); diff --git a/lib/cmp_io.c b/lib/cmp_io.c index a730ea922fd88eb0e93c0b7bb1655715e2125bb1..b1ab76b7e29126fad1650ed9ac4a2f78b0df55d7 100644 --- a/lib/cmp_io.c +++ b/lib/cmp_io.c @@ -81,7 +81,7 @@ void print_help(const char *program_name) printf(" -o <prefix> Use the <prefix> for output files\n"); printf(" -n, --model_cfg Print a default model configuration and exit\n"); printf(" --diff_cfg Print a default 1d-differencing configuration and exit\n"); - printf(" --binary Read and write files in binary format\n"); + printf(" -b, --binary Read and write files in binary format\n"); printf(" --no_header Do not add a compression entity header in front of the compressed data\n"); printf(" -a, --rdcu_par Add additional RDCU control parameters\n"); printf(" -V, --version Print program version and exit\n");