From 5e1eee2370cfed0623e1803e81f16787bc1cba20 Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Thu, 14 Apr 2022 10:59:27 -0500 Subject: 1.8 Move error-stack text to top of usage display #1564 (#1569) --- tools/h5copy/h5copy.c | 17 +++++++++++------ tools/h5diff/h5diff_common.c | 18 +++++++++++------- tools/h5diff/testfiles/h5diff_10.txt | 7 ++++--- tools/h5diff/testfiles/h5diff_600.txt | 7 ++++--- tools/h5diff/testfiles/h5diff_603.txt | 7 ++++--- tools/h5diff/testfiles/h5diff_606.txt | 7 ++++--- tools/h5diff/testfiles/h5diff_612.txt | 7 ++++--- tools/h5diff/testfiles/h5diff_615.txt | 7 ++++--- tools/h5diff/testfiles/h5diff_621.txt | 7 ++++--- tools/h5diff/testfiles/h5diff_622.txt | 7 ++++--- tools/h5diff/testfiles/h5diff_623.txt | 7 ++++--- tools/h5diff/testfiles/h5diff_624.txt | 7 ++++--- tools/h5dump/h5dump.c | 10 ++++++---- tools/h5ls/h5ls.c | 6 +++--- tools/h5repack/h5repack_main.c | 15 ++++++++++----- tools/h5repack/testfiles/h5repack-help.txt | 5 +++-- tools/h5stat/h5stat.c | 13 +++++++++---- tools/h5stat/testfiles/h5stat_help1.ddl | 4 +++- tools/h5stat/testfiles/h5stat_help2.ddl | 4 +++- tools/h5stat/testfiles/h5stat_nofile.ddl | 4 +++- tools/testfiles/h5dump-help.txt | 6 ++++-- tools/testfiles/pbits/tnofilename-with-packed-bits.ddl | 6 ++++-- tools/testfiles/pbits/tpbitsIncomplete.ddl | 6 ++++-- tools/testfiles/pbits/tpbitsLengthExceeded.ddl | 6 ++++-- tools/testfiles/pbits/tpbitsLengthPositive.ddl | 6 ++++-- tools/testfiles/pbits/tpbitsMaxExceeded.ddl | 6 ++++-- tools/testfiles/pbits/tpbitsOffsetExceeded.ddl | 6 ++++-- tools/testfiles/pbits/tpbitsOffsetNegative.ddl | 6 ++++-- 28 files changed, 134 insertions(+), 80 deletions(-) diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c index 8b61918..63d83b8 100644 --- a/tools/h5copy/h5copy.c +++ b/tools/h5copy/h5copy.c @@ -19,7 +19,7 @@ #define PROGRAMNAME "h5copy" /* command-line options: short and long-named parameters */ -static const char * s_opts = "d:f:hi:o:ps:vVE"; +static const char * s_opts = "d:f:hi:o:ps:vVE*"; static struct long_options l_opts[] = {{"destination", require_arg, 'd'}, {"flag", require_arg, 'f'}, {"help", no_arg, 'h'}, @@ -29,7 +29,7 @@ static struct long_options l_opts[] = {{"destination", require_arg, 'd'}, {"source", require_arg, 's'}, {"verbose", no_arg, 'v'}, {"version", no_arg, 'V'}, - {"enable-error-stack", no_arg, 'E'}, + {"enable-error-stack", optional_arg, 'E'}, {NULL, 0, '\0'}}; char * fname_src = NULL; char * fname_dst = NULL; @@ -93,15 +93,17 @@ usage(void) PRINTVALSTREAM(rawoutstream, " -o, --output output file name\n"); PRINTVALSTREAM(rawoutstream, " -s, --source source object name\n"); PRINTVALSTREAM(rawoutstream, " -d, --destination destination object name\n"); + PRINTVALSTREAM(rawoutstream, " ERROR\n"); + PRINTVALSTREAM(rawoutstream, + " --enable-error-stack Prints messages from the HDF5 error stack as they occur.\n"); + PRINTVALSTREAM(rawoutstream, + " Optional value 2 also prints file open errors.\n"); PRINTVALSTREAM(rawoutstream, " OPTIONS\n"); PRINTVALSTREAM(rawoutstream, " -h, --help Print a usage message and exit\n"); PRINTVALSTREAM(rawoutstream, " -p, --parents No error if existing, make parent groups as needed\n"); PRINTVALSTREAM(rawoutstream, " -v, --verbose Print information about OBJECTS and OPTIONS\n"); PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n"); - PRINTVALSTREAM(rawoutstream, " --enable-error-stack\n"); - PRINTVALSTREAM(rawoutstream, - " Prints messages from the HDF5 error stack as they occur.\n"); PRINTVALSTREAM(rawoutstream, " -f, --flag Flag type\n\n"); PRINTVALSTREAM(rawoutstream, " Flag type is one of the following strings:\n\n"); PRINTVALSTREAM(rawoutstream, " shallow Copy only immediate members for groups\n\n"); @@ -288,7 +290,10 @@ main(int argc, char *argv[]) break; case 'E': - enable_error_stack = 1; + if (opt_arg != NULL) + enable_error_stack = HDatoi(opt_arg); + else + enable_error_stack = 1; break; default: diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c index 4a36ef4..4add08d 100644 --- a/tools/h5diff/h5diff_common.c +++ b/tools/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'}, @@ -41,7 +41,7 @@ static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"no-dangling-links", no_arg, 'x'}, {"exclude-path", require_arg, 'E'}, {"exclude-attribute", require_arg, 'A'}, - {"enable-error-stack", no_arg, 'S'}, + {"enable-error-stack", optional_arg, 'S'}, {NULL, 0, '\0'}}; /*------------------------------------------------------------------------- @@ -288,7 +288,10 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const break; case 'S': - enable_error_stack = 1; + if (opt_arg != NULL) + enable_error_stack = HDatoi(opt_arg); + else + enable_error_stack = 1; break; case 'E': @@ -576,6 +579,10 @@ usage(void) PRINTVALSTREAM(rawoutstream, " [obj1] Name of an HDF5 object, in absolute path\n"); PRINTVALSTREAM(rawoutstream, " [obj2] Name of an HDF5 object, in absolute path\n"); PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " ERROR\n"); + PRINTVALSTREAM(rawoutstream, + " --enable-error-stack Prints messages from the HDF5 error stack as they occur.\n"); + PRINTVALSTREAM(rawoutstream, " Optional value 2 also prints file open errors.\n"); PRINTVALSTREAM(rawoutstream, " OPTIONS\n"); PRINTVALSTREAM(rawoutstream, " -h, --help\n"); PRINTVALSTREAM(rawoutstream, " Print a usage message and exit.\n"); @@ -598,9 +605,6 @@ usage(void) PRINTVALSTREAM(rawoutstream, " 3 : All level 2 information plus file names.\n"); PRINTVALSTREAM(rawoutstream, " -q, --quiet\n"); PRINTVALSTREAM(rawoutstream, " Quiet mode. Do not produce output.\n"); - PRINTVALSTREAM(rawoutstream, " --enable-error-stack\n"); - PRINTVALSTREAM(rawoutstream, - " Prints messages from the HDF5 error stack as they occur.\n"); PRINTVALSTREAM(rawoutstream, " --follow-symlinks\n"); PRINTVALSTREAM(rawoutstream, " Follow symbolic links (soft links and external links and compare the)\n"); @@ -722,7 +726,7 @@ usage(void) PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " Modes of output:\n"); PRINTVALSTREAM(rawoutstream, - " Default mode: print the number of differences found and where they occured\n"); + " Default mode: print the number of differences found and where they occurred\n"); PRINTVALSTREAM(rawoutstream, " -r Report mode: print the above plus the differences\n"); PRINTVALSTREAM(rawoutstream, " -v Verbose mode: print the above plus a list of objects and warnings\n"); PRINTVALSTREAM(rawoutstream, " -q Quiet mode: do not print output\n"); diff --git a/tools/h5diff/testfiles/h5diff_10.txt b/tools/h5diff/testfiles/h5diff_10.txt index 5804ac3..2f2f21e 100644 --- a/tools/h5diff/testfiles/h5diff_10.txt +++ b/tools/h5diff/testfiles/h5diff_10.txt @@ -4,6 +4,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] [obj1] Name of an HDF5 object, in absolute path [obj2] Name of an HDF5 object, in absolute path + ERROR + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. OPTIONS -h, --help Print a usage message and exit. @@ -22,8 +25,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. - --enable-error-stack - Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. @@ -105,7 +106,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] This option can be used repeatedly to exclude multiple paths. Modes of output: - Default mode: print the number of differences found and where they occured + Default mode: print the number of differences found and where they occurred -r Report mode: print the above plus the differences -v Verbose mode: print the above plus a list of objects and warnings -q Quiet mode: do not print output diff --git a/tools/h5diff/testfiles/h5diff_600.txt b/tools/h5diff/testfiles/h5diff_600.txt index fa7447b..385af242 100644 --- a/tools/h5diff/testfiles/h5diff_600.txt +++ b/tools/h5diff/testfiles/h5diff_600.txt @@ -4,6 +4,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] [obj1] Name of an HDF5 object, in absolute path [obj2] Name of an HDF5 object, in absolute path + ERROR + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. OPTIONS -h, --help Print a usage message and exit. @@ -22,8 +25,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. - --enable-error-stack - Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. @@ -105,7 +106,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] This option can be used repeatedly to exclude multiple paths. Modes of output: - Default mode: print the number of differences found and where they occured + Default mode: print the number of differences found and where they occurred -r Report mode: print the above plus the differences -v Verbose mode: print the above plus a list of objects and warnings -q Quiet mode: do not print output diff --git a/tools/h5diff/testfiles/h5diff_603.txt b/tools/h5diff/testfiles/h5diff_603.txt index 9e1dc89..d5dc978 100644 --- a/tools/h5diff/testfiles/h5diff_603.txt +++ b/tools/h5diff/testfiles/h5diff_603.txt @@ -5,6 +5,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] [obj1] Name of an HDF5 object, in absolute path [obj2] Name of an HDF5 object, in absolute path + ERROR + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. OPTIONS -h, --help Print a usage message and exit. @@ -23,8 +26,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. - --enable-error-stack - Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. @@ -106,7 +107,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] This option can be used repeatedly to exclude multiple paths. Modes of output: - Default mode: print the number of differences found and where they occured + Default mode: print the number of differences found and where they occurred -r Report mode: print the above plus the differences -v Verbose mode: print the above plus a list of objects and warnings -q Quiet mode: do not print output diff --git a/tools/h5diff/testfiles/h5diff_606.txt b/tools/h5diff/testfiles/h5diff_606.txt index 146b944..60181dd 100644 --- a/tools/h5diff/testfiles/h5diff_606.txt +++ b/tools/h5diff/testfiles/h5diff_606.txt @@ -5,6 +5,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] [obj1] Name of an HDF5 object, in absolute path [obj2] Name of an HDF5 object, in absolute path + ERROR + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. OPTIONS -h, --help Print a usage message and exit. @@ -23,8 +26,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. - --enable-error-stack - Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. @@ -106,7 +107,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] This option can be used repeatedly to exclude multiple paths. Modes of output: - Default mode: print the number of differences found and where they occured + Default mode: print the number of differences found and where they occurred -r Report mode: print the above plus the differences -v Verbose mode: print the above plus a list of objects and warnings -q Quiet mode: do not print output diff --git a/tools/h5diff/testfiles/h5diff_612.txt b/tools/h5diff/testfiles/h5diff_612.txt index 511e693..c027655 100644 --- a/tools/h5diff/testfiles/h5diff_612.txt +++ b/tools/h5diff/testfiles/h5diff_612.txt @@ -5,6 +5,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] [obj1] Name of an HDF5 object, in absolute path [obj2] Name of an HDF5 object, in absolute path + ERROR + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. OPTIONS -h, --help Print a usage message and exit. @@ -23,8 +26,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. - --enable-error-stack - Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. @@ -106,7 +107,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] This option can be used repeatedly to exclude multiple paths. Modes of output: - Default mode: print the number of differences found and where they occured + Default mode: print the number of differences found and where they occurred -r Report mode: print the above plus the differences -v Verbose mode: print the above plus a list of objects and warnings -q Quiet mode: do not print output diff --git a/tools/h5diff/testfiles/h5diff_615.txt b/tools/h5diff/testfiles/h5diff_615.txt index c4b41f9..792741c 100644 --- a/tools/h5diff/testfiles/h5diff_615.txt +++ b/tools/h5diff/testfiles/h5diff_615.txt @@ -5,6 +5,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] [obj1] Name of an HDF5 object, in absolute path [obj2] Name of an HDF5 object, in absolute path + ERROR + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. OPTIONS -h, --help Print a usage message and exit. @@ -23,8 +26,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. - --enable-error-stack - Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. @@ -106,7 +107,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] This option can be used repeatedly to exclude multiple paths. Modes of output: - Default mode: print the number of differences found and where they occured + Default mode: print the number of differences found and where they occurred -r Report mode: print the above plus the differences -v Verbose mode: print the above plus a list of objects and warnings -q Quiet mode: do not print output diff --git a/tools/h5diff/testfiles/h5diff_621.txt b/tools/h5diff/testfiles/h5diff_621.txt index 9dd312d..27d9f09 100644 --- a/tools/h5diff/testfiles/h5diff_621.txt +++ b/tools/h5diff/testfiles/h5diff_621.txt @@ -5,6 +5,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] [obj1] Name of an HDF5 object, in absolute path [obj2] Name of an HDF5 object, in absolute path + ERROR + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. OPTIONS -h, --help Print a usage message and exit. @@ -23,8 +26,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. - --enable-error-stack - Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. @@ -106,7 +107,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] This option can be used repeatedly to exclude multiple paths. Modes of output: - Default mode: print the number of differences found and where they occured + Default mode: print the number of differences found and where they occurred -r Report mode: print the above plus the differences -v Verbose mode: print the above plus a list of objects and warnings -q Quiet mode: do not print output diff --git a/tools/h5diff/testfiles/h5diff_622.txt b/tools/h5diff/testfiles/h5diff_622.txt index 0f7c4af..2c0395d 100644 --- a/tools/h5diff/testfiles/h5diff_622.txt +++ b/tools/h5diff/testfiles/h5diff_622.txt @@ -5,6 +5,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] [obj1] Name of an HDF5 object, in absolute path [obj2] Name of an HDF5 object, in absolute path + ERROR + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. OPTIONS -h, --help Print a usage message and exit. @@ -23,8 +26,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. - --enable-error-stack - Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. @@ -106,7 +107,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] This option can be used repeatedly to exclude multiple paths. Modes of output: - Default mode: print the number of differences found and where they occured + Default mode: print the number of differences found and where they occurred -r Report mode: print the above plus the differences -v Verbose mode: print the above plus a list of objects and warnings -q Quiet mode: do not print output diff --git a/tools/h5diff/testfiles/h5diff_623.txt b/tools/h5diff/testfiles/h5diff_623.txt index 3e1b5f3..ddf110c 100644 --- a/tools/h5diff/testfiles/h5diff_623.txt +++ b/tools/h5diff/testfiles/h5diff_623.txt @@ -5,6 +5,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] [obj1] Name of an HDF5 object, in absolute path [obj2] Name of an HDF5 object, in absolute path + ERROR + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. OPTIONS -h, --help Print a usage message and exit. @@ -23,8 +26,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. - --enable-error-stack - Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. @@ -106,7 +107,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] This option can be used repeatedly to exclude multiple paths. Modes of output: - Default mode: print the number of differences found and where they occured + Default mode: print the number of differences found and where they occurred -r Report mode: print the above plus the differences -v Verbose mode: print the above plus a list of objects and warnings -q Quiet mode: do not print output diff --git a/tools/h5diff/testfiles/h5diff_624.txt b/tools/h5diff/testfiles/h5diff_624.txt index 0645961..d9534ae 100644 --- a/tools/h5diff/testfiles/h5diff_624.txt +++ b/tools/h5diff/testfiles/h5diff_624.txt @@ -5,6 +5,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] [obj1] Name of an HDF5 object, in absolute path [obj2] Name of an HDF5 object, in absolute path + ERROR + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. OPTIONS -h, --help Print a usage message and exit. @@ -23,8 +26,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. - --enable-error-stack - Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. @@ -106,7 +107,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] This option can be used repeatedly to exclude multiple paths. Modes of output: - Default mode: print the number of differences found and where they occured + Default mode: print the number of differences found and where they occurred -r Report mode: print the above plus the differences -v Verbose mode: print the above plus a list of objects and warnings -q Quiet mode: do not print output diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index f8b5872..97a79cb 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -231,6 +231,12 @@ usage(const char *prog) PRINTVALSTREAM(rawoutstream, " OPTIONS\n"); PRINTVALSTREAM(rawoutstream, " -h, --help Print a usage message and exit\n"); PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n"); + PRINTVALSTREAM(rawoutstream, "--------------- Error Options ---------------\n"); + PRINTVALSTREAM(rawoutstream, + " --enable-error-stack Prints messages from the HDF5 error stack as they occur.\n"); + PRINTVALSTREAM(rawoutstream, + " Optional value 2 also prints file open errors.\n"); + PRINTVALSTREAM(rawoutstream, " Default setting disables any error reporting.\n"); PRINTVALSTREAM(rawoutstream, "--------------- File Options ---------------\n"); PRINTVALSTREAM(rawoutstream, " -n, --contents Print a list of the file contents and exit\n"); PRINTVALSTREAM(rawoutstream, " Optional value 1 also prints attributes.\n"); @@ -299,10 +305,6 @@ usage(const char *prog) PRINTVALSTREAM(rawoutstream, " -q Q, --sort_by=Q Sort groups and attributes by index Q\n"); PRINTVALSTREAM(rawoutstream, " -z Z, --sort_order=Z Sort groups and attributes by order Z\n"); PRINTVALSTREAM(rawoutstream, - " --enable-error-stack Prints messages from the HDF5 error stack as they occur.\n"); - PRINTVALSTREAM(rawoutstream, - " Optional value 2 also prints file open errors.\n"); - PRINTVALSTREAM(rawoutstream, " --no-compact-subset Disable compact form of subsetting and allow the use\n"); PRINTVALSTREAM(rawoutstream, " of \"[\" in dataset names.\n"); PRINTVALSTREAM(rawoutstream, diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index ef230e6..a4eecdf 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -32,7 +32,7 @@ #define NAME_BUF_SIZE 2048 /* - * Alternative formating for data dumped by H5LS + * Alternative formatting for data dumped by H5LS * * This table only affects H5LS output. */ @@ -2467,7 +2467,7 @@ done: * were borrowed from the GNU less(1). * * Return: Success: Number of columns. - * Failure: Some default number of columms. + * Failure: Some default number of columns. *------------------------------------------------------------------------- */ static int @@ -2656,9 +2656,9 @@ main(int argc, char *argv[]) } else if (!HDstrcmp(argv[argno], "--enable-error-stack")) { enable_error_stack = 1; - /* deprecated --errors */ } else if (!HDstrcmp(argv[argno], "--errors")) { + /* deprecated --errors */ enable_error_stack = 1; } else if (!HDstrcmp(argv[argno], "--follow-symlinks")) { diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index 40931b1..ee2fec5 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -50,7 +50,7 @@ static struct long_options l_opts[] = {{"alignment", require_arg, 'a'}, {"ublock", require_arg, 'u'}, {"verbose", no_arg, 'v'}, {"sort_order", require_arg, 'z'}, - {"enable-error-stack", no_arg, 'E'}, + {"enable-error-stack", optional_arg, 'E'}, {"latest", no_arg, 'L'}, {"metadata_block_size", require_arg, 'M'}, {"version", no_arg, 'V'}, @@ -74,14 +74,16 @@ usage(const char *prog) PRINTSTREAM(rawoutstream, "usage: %s [OPTIONS] file1 file2\n", prog); PRINTVALSTREAM(rawoutstream, " file1 Input HDF5 File\n"); PRINTVALSTREAM(rawoutstream, " file2 Output HDF5 File\n"); + PRINTVALSTREAM(rawoutstream, " ERROR\n"); + PRINTVALSTREAM(rawoutstream, + " --enable-error-stack Prints messages from the HDF5 error stack as they occur.\n"); + PRINTVALSTREAM(rawoutstream, + " Optional value 2 also prints file open errors.\n"); PRINTVALSTREAM(rawoutstream, " OPTIONS\n"); PRINTVALSTREAM(rawoutstream, " -h, --help Print a usage message and exit\n"); PRINTVALSTREAM(rawoutstream, " -v, --verbose Verbose mode, print object information\n"); PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n"); PRINTVALSTREAM(rawoutstream, " -n, --native Use a native HDF5 type when repacking\n"); - PRINTVALSTREAM(rawoutstream, - " --enable-error-stack Prints messages from the HDF5 error stack as they\n"); - PRINTVALSTREAM(rawoutstream, " occur\n"); PRINTVALSTREAM(rawoutstream, " -L, --latest Use latest version of file format\n"); PRINTVALSTREAM(rawoutstream, " --merge Follow external soft link recursively and merge data\n"); @@ -554,7 +556,10 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) break; case 'E': - enable_error_stack = 1; + if (opt_arg != NULL) + enable_error_stack = HDatoi(opt_arg); + else + enable_error_stack = 1; break; default: diff --git a/tools/h5repack/testfiles/h5repack-help.txt b/tools/h5repack/testfiles/h5repack-help.txt index 4927fe4..47f879b 100644 --- a/tools/h5repack/testfiles/h5repack-help.txt +++ b/tools/h5repack/testfiles/h5repack-help.txt @@ -1,13 +1,14 @@ usage: h5repack [OPTIONS] file1 file2 file1 Input HDF5 File file2 Output HDF5 File + ERROR + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. OPTIONS -h, --help Print a usage message and exit -v, --verbose Verbose mode, print object information -V, --version Print version number and exit -n, --native Use a native HDF5 type when repacking - --enable-error-stack Prints messages from the HDF5 error stack as they - occur -L, --latest Use latest version of file format --merge Follow external soft link recursively and merge data --prune Do not follow external soft links and remove link diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index 3ef70e2..b9e3ea4 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -148,7 +148,7 @@ struct handler_t { char **obj; }; -static const char *s_opts = "Aa:Ddm:EFfhGgl:STO:Vw:H:"; +static const char *s_opts = "Aa:Ddm:E*FfhGgl:STO:Vw:H:"; /* e.g. "filemetadata" has to precede "file"; "groupmetadata" has to precede "group" etc. */ static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, @@ -225,7 +225,7 @@ static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"attr", no_arg, 'A'}, {"att", no_arg, 'A'}, {"at", no_arg, 'A'}, - {"enable-error-stack", no_arg, 'E'}, + {"enable-error-stack", optional_arg, 'E'}, {"numattrs", require_arg, 'a'}, {"numattr", require_arg, 'a'}, {"numatt", require_arg, 'a'}, @@ -265,6 +265,9 @@ usage(const char *prog) HDfflush(stdout); HDfprintf(stdout, "Usage: %s [OPTIONS] file\n", prog); HDfprintf(stdout, "\n"); + HDfprintf(stdout, " ERROR\n"); + HDfprintf(stdout, " --enable-error-stack Prints messages from the HDF5 error stack as they occur\n"); + HDfprintf(stdout, " Optional value 2 also prints file open errors\n"); HDfprintf(stdout, " OPTIONS\n"); HDfprintf(stdout, " -h, --help Print a usage message and exit\n"); HDfprintf(stdout, " -V, --version Print version number and exit\n"); @@ -288,7 +291,6 @@ usage(const char *prog) " information for small # of attributes. N is an integer greater\n"); HDfprintf(stdout, " than 0. The default threshold is 10.\n"); HDfprintf(stdout, " -S, --summary Print summary of file space information\n"); - HDfprintf(stdout, " --enable-error-stack Prints messages from the HDF5 error stack as they occur\n"); HDfprintf(stdout, " --s3-cred= Access file on S3, using provided credential\n"); HDfprintf(stdout, " :: (region,id,key)\n"); HDfprintf(stdout, " If == \"(,,)\", no authentication is used.\n"); @@ -839,7 +841,10 @@ parse_command_line(int argc, const char *const *argv, struct handler_t **hand_re break; case 'E': - enable_error_stack = 1; + if (opt_arg != NULL) + enable_error_stack = HDatoi(opt_arg); + else + enable_error_stack = 1; break; case 'F': diff --git a/tools/h5stat/testfiles/h5stat_help1.ddl b/tools/h5stat/testfiles/h5stat_help1.ddl index e722f74..3db0a4a 100644 --- a/tools/h5stat/testfiles/h5stat_help1.ddl +++ b/tools/h5stat/testfiles/h5stat_help1.ddl @@ -1,5 +1,8 @@ Usage: h5stat [OPTIONS] file + ERROR + --enable-error-stack Prints messages from the HDF5 error stack as they occur + Optional value 2 also prints file open errors OPTIONS -h, --help Print a usage message and exit -V, --version Print version number and exit @@ -21,7 +24,6 @@ Usage: h5stat [OPTIONS] file information for small # of attributes. N is an integer greater than 0. The default threshold is 10. -S, --summary Print summary of file space information - --enable-error-stack Prints messages from the HDF5 error stack as they occur --s3-cred= Access file on S3, using provided credential :: (region,id,key) If == "(,,)", no authentication is used. diff --git a/tools/h5stat/testfiles/h5stat_help2.ddl b/tools/h5stat/testfiles/h5stat_help2.ddl index e722f74..3db0a4a 100644 --- a/tools/h5stat/testfiles/h5stat_help2.ddl +++ b/tools/h5stat/testfiles/h5stat_help2.ddl @@ -1,5 +1,8 @@ Usage: h5stat [OPTIONS] file + ERROR + --enable-error-stack Prints messages from the HDF5 error stack as they occur + Optional value 2 also prints file open errors OPTIONS -h, --help Print a usage message and exit -V, --version Print version number and exit @@ -21,7 +24,6 @@ Usage: h5stat [OPTIONS] file information for small # of attributes. N is an integer greater than 0. The default threshold is 10. -S, --summary Print summary of file space information - --enable-error-stack Prints messages from the HDF5 error stack as they occur --s3-cred= Access file on S3, using provided credential :: (region,id,key) If == "(,,)", no authentication is used. diff --git a/tools/h5stat/testfiles/h5stat_nofile.ddl b/tools/h5stat/testfiles/h5stat_nofile.ddl index e722f74..3db0a4a 100644 --- a/tools/h5stat/testfiles/h5stat_nofile.ddl +++ b/tools/h5stat/testfiles/h5stat_nofile.ddl @@ -1,5 +1,8 @@ Usage: h5stat [OPTIONS] file + ERROR + --enable-error-stack Prints messages from the HDF5 error stack as they occur + Optional value 2 also prints file open errors OPTIONS -h, --help Print a usage message and exit -V, --version Print version number and exit @@ -21,7 +24,6 @@ Usage: h5stat [OPTIONS] file information for small # of attributes. N is an integer greater than 0. The default threshold is 10. -S, --summary Print summary of file space information - --enable-error-stack Prints messages from the HDF5 error stack as they occur --s3-cred= Access file on S3, using provided credential :: (region,id,key) If == "(,,)", no authentication is used. diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt index 6afa19c..a495af2 100644 --- a/tools/testfiles/h5dump-help.txt +++ b/tools/testfiles/h5dump-help.txt @@ -2,6 +2,10 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -V, --version Print version number and exit +--------------- Error Options --------------- + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. + Default setting disables any error reporting. --------------- File Options --------------- -n, --contents Print a list of the file contents and exit Optional value 1 also prints attributes. @@ -52,8 +56,6 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they occur. - Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) diff --git a/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl index 6afa19c..a495af2 100644 --- a/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl +++ b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl @@ -2,6 +2,10 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -V, --version Print version number and exit +--------------- Error Options --------------- + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. + Default setting disables any error reporting. --------------- File Options --------------- -n, --contents Print a list of the file contents and exit Optional value 1 also prints attributes. @@ -52,8 +56,6 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they occur. - Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) diff --git a/tools/testfiles/pbits/tpbitsIncomplete.ddl b/tools/testfiles/pbits/tpbitsIncomplete.ddl index 6afa19c..a495af2 100644 --- a/tools/testfiles/pbits/tpbitsIncomplete.ddl +++ b/tools/testfiles/pbits/tpbitsIncomplete.ddl @@ -2,6 +2,10 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -V, --version Print version number and exit +--------------- Error Options --------------- + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. + Default setting disables any error reporting. --------------- File Options --------------- -n, --contents Print a list of the file contents and exit Optional value 1 also prints attributes. @@ -52,8 +56,6 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they occur. - Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) diff --git a/tools/testfiles/pbits/tpbitsLengthExceeded.ddl b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl index 6afa19c..a495af2 100644 --- a/tools/testfiles/pbits/tpbitsLengthExceeded.ddl +++ b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl @@ -2,6 +2,10 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -V, --version Print version number and exit +--------------- Error Options --------------- + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. + Default setting disables any error reporting. --------------- File Options --------------- -n, --contents Print a list of the file contents and exit Optional value 1 also prints attributes. @@ -52,8 +56,6 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they occur. - Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) diff --git a/tools/testfiles/pbits/tpbitsLengthPositive.ddl b/tools/testfiles/pbits/tpbitsLengthPositive.ddl index 6afa19c..a495af2 100644 --- a/tools/testfiles/pbits/tpbitsLengthPositive.ddl +++ b/tools/testfiles/pbits/tpbitsLengthPositive.ddl @@ -2,6 +2,10 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -V, --version Print version number and exit +--------------- Error Options --------------- + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. + Default setting disables any error reporting. --------------- File Options --------------- -n, --contents Print a list of the file contents and exit Optional value 1 also prints attributes. @@ -52,8 +56,6 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they occur. - Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) diff --git a/tools/testfiles/pbits/tpbitsMaxExceeded.ddl b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl index 6afa19c..a495af2 100644 --- a/tools/testfiles/pbits/tpbitsMaxExceeded.ddl +++ b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl @@ -2,6 +2,10 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -V, --version Print version number and exit +--------------- Error Options --------------- + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. + Default setting disables any error reporting. --------------- File Options --------------- -n, --contents Print a list of the file contents and exit Optional value 1 also prints attributes. @@ -52,8 +56,6 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they occur. - Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) diff --git a/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl index 6afa19c..a495af2 100644 --- a/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl +++ b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl @@ -2,6 +2,10 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -V, --version Print version number and exit +--------------- Error Options --------------- + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. + Default setting disables any error reporting. --------------- File Options --------------- -n, --contents Print a list of the file contents and exit Optional value 1 also prints attributes. @@ -52,8 +56,6 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they occur. - Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) diff --git a/tools/testfiles/pbits/tpbitsOffsetNegative.ddl b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl index 6afa19c..a495af2 100644 --- a/tools/testfiles/pbits/tpbitsOffsetNegative.ddl +++ b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl @@ -2,6 +2,10 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -V, --version Print version number and exit +--------------- Error Options --------------- + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. + Default setting disables any error reporting. --------------- File Options --------------- -n, --contents Print a list of the file contents and exit Optional value 1 also prints attributes. @@ -52,8 +56,6 @@ usage: h5dump [OPTIONS] files -m T, --format=T Set the floating point output format -q Q, --sort_by=Q Sort groups and attributes by index Q -z Z, --sort_order=Z Sort groups and attributes by order Z - --enable-error-stack Prints messages from the HDF5 error stack as they occur. - Optional value 2 also prints file open errors. --no-compact-subset Disable compact form of subsetting and allow the use of "[" in dataset names. -w N, --width=N Set the number of columns of output. A value of 0 (zero) -- cgit v0.12