diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2021-01-27 13:56:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-27 13:56:28 (GMT) |
commit | 799ec0fde45a883e3652f29a1f66dd2fdb4c56f9 (patch) | |
tree | d6e9bfbfbc6f8364a38d83d44f62dbe753d13e24 /tools/src/h5diff | |
parent | d7bce33123c9c3eea9e7399de68b2e74a55f3809 (diff) | |
download | hdf5-799ec0fde45a883e3652f29a1f66dd2fdb4c56f9.zip hdf5-799ec0fde45a883e3652f29a1f66dd2fdb4c56f9.tar.gz hdf5-799ec0fde45a883e3652f29a1f66dd2fdb4c56f9.tar.bz2 |
Small fixes (#285)
* OESS-98 convert plugin option to FetchContent, add tests
* Fixes for pkcfg files because of plugin option
* OESS-98 fix tools test for plugins
* Keep doxygen comments under 100 chars long - format hint
* Whitespace
* HDFFV-11144 - Reclassify CMake messages
* HDFFV-11099/11100 added help text
* Reworked switch statement to compare string instead
* Fix typo
* Update CDash mode
* Correct name of threadsafe
* Correct option name
* Undo accidental commit
* Small changes plus merge of tools arg parse from 1.12
Diffstat (limited to 'tools/src/h5diff')
-rw-r--r-- | tools/src/h5diff/h5diff_common.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index 95245bd..5646e2a 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -25,7 +25,7 @@ static int check_d_input(const char *); * Command-line options: The user can specify short or long-named * parameters. */ -static const char * s_opts = "hVrv:qn:d:p:NcelxE:A:S"; +static const char * s_opts = "hVrv*qn:d:p:NcelxE:A:S"; static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"version", no_arg, 'V'}, {"report", no_arg, 'r'}, @@ -253,33 +253,27 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char case 'v': opts->mode_verbose = 1; - /* This for loop is for handling style like - * -v, -v1, --verbose, --verbose=1. - */ for (i = 1; i < argc; i++) { /* - * short opt + * special check for short opt */ - if (!strcmp(argv[i], "-v")) { /* no arg */ - opt_ind--; + if (!strcmp(argv[i], "-v")) { + if (opt_arg != NULL) + opt_ind--; opts->mode_verbose_level = 0; break; } else if (!strncmp(argv[i], "-v", (size_t)2)) { + if (opt_arg != NULL) + opt_ind--; opts->mode_verbose_level = atoi(&argv[i][2]); break; } - - /* - * long opt - */ - if (!strcmp(argv[i], "--verbose")) { /* no arg */ - opts->mode_verbose_level = 0; - break; - } - else if (!strncmp(argv[i], "--verbose", (size_t)9) && argv[i][9] == '=') { - opts->mode_verbose_level = atoi(&argv[i][10]); - break; + else { + if (opt_arg != NULL) + opts->mode_verbose_level = HDatoi(opt_arg); + else + opts->mode_verbose_level = 0; } } break; |