summaryrefslogtreecommitdiffstats
path: root/tools/src/h5repack/h5repack_main.c
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2022-04-01 20:55:47 (GMT)
committerGitHub <noreply@github.com>2022-04-01 20:55:47 (GMT)
commit2f9c53739b5149875dbb45f3a12091c0782b1d10 (patch)
tree91220d3f4c06269edbe9d13ba5fef20f60d87843 /tools/src/h5repack/h5repack_main.c
parent572adbaacb126e530f6af94a90092e004c23a163 (diff)
downloadhdf5-2f9c53739b5149875dbb45f3a12091c0782b1d10.zip
hdf5-2f9c53739b5149875dbb45f3a12091c0782b1d10.tar.gz
hdf5-2f9c53739b5149875dbb45f3a12091c0782b1d10.tar.bz2
1.12 Move error-stack text to top of usage display #1564 (#1566)
Diffstat (limited to 'tools/src/h5repack/h5repack_main.c')
-rw-r--r--tools/src/h5repack/h5repack_main.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c
index c83f8cc..29af231 100644
--- a/tools/src/h5repack/h5repack_main.c
+++ b/tools/src/h5repack/h5repack_main.c
@@ -31,7 +31,7 @@ const char *outfile = NULL;
* Command-line options: The user can specify short or long-named
* parameters.
*/
-static const char * s_opts = "a:b:c:d:e:f:hi:j:k:l:m:no:q:s:t:u:vz:EG:LM:P:S:T:VXW";
+static const char * s_opts = "a:b:c:d:e:f:hi:j:k:l:m:no:q:s:t:u:vz:E*G:LM:P:S:T:VXW";
static struct long_options l_opts[] = {{"alignment", require_arg, 'a'},
{"block", require_arg, 'b'},
{"compact", require_arg, 'c'},
@@ -52,7 +52,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'},
{"fs_pagesize", require_arg, 'G'},
{"latest", no_arg, 'L'},
{"metadata_block_size", require_arg, 'M'},
@@ -86,15 +86,17 @@ 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,
" --src-vol-value Value (ID) of the VOL connector to use for opening the\n");
PRINTVALSTREAM(rawoutstream, " input HDF5 file specified\n");
PRINTVALSTREAM(rawoutstream,
@@ -735,7 +737,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;
case '1':