diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2022-04-14 13:59:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-14 13:59:07 (GMT) |
commit | 1a1e59172dc6312808981baeca4bc1772e126ff3 (patch) | |
tree | cdc409def6f9dd634c3aa335bee8cf8183c071c3 /tools/src/h5repack/h5repack_main.c | |
parent | c81841b715491437cf27ed6cc6ce0ada92ae230a (diff) | |
download | hdf5-1a1e59172dc6312808981baeca4bc1772e126ff3.zip hdf5-1a1e59172dc6312808981baeca4bc1772e126ff3.tar.gz hdf5-1a1e59172dc6312808981baeca4bc1772e126ff3.tar.bz2 |
1.10 Move error-stack text to top of usage display #1564 (#1567)
Diffstat (limited to 'tools/src/h5repack/h5repack_main.c')
-rw-r--r-- | tools/src/h5repack/h5repack_main.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 8ab9637..bc6a605 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'}, @@ -80,14 +80,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, " This option will take precedence over the options\n"); @@ -700,7 +702,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: |