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/h5stat/h5stat.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/h5stat/h5stat.c')
-rw-r--r-- | tools/src/h5stat/h5stat.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c index d36c348..78f20b2 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -169,7 +169,7 @@ struct handler_t { char **obj; }; -static const char *s_opts = "Aa:Ddm:EFfhGgl:sSTO:Vw:H:"; +static const char *s_opts = "Aa:Ddm:E*FfhGgl:sSTO: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'}, {"filemetadata", no_arg, 'F'}, @@ -181,7 +181,7 @@ static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"object", require_arg, 'O'}, {"version", no_arg, 'V'}, {"attribute", no_arg, 'A'}, - {"enable-error-stack", no_arg, 'E'}, + {"enable-error-stack", optional_arg, 'E'}, {"numattrs", require_arg, 'a'}, {"freespace", no_arg, 's'}, {"summary", no_arg, 'S'}, @@ -211,6 +211,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"); @@ -235,7 +238,6 @@ usage(const char *prog) HDfprintf(stdout, " than 0. The default threshold is 10.\n"); HDfprintf(stdout, " -s, --freespace Print free space information\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=<cred> Access file on S3, using provided credential\n"); HDfprintf(stdout, " <cred> :: (region,id,key)\n"); HDfprintf(stdout, " If <cred> == \"(,,)\", no authentication is used.\n"); @@ -846,7 +848,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': @@ -1746,7 +1751,7 @@ main(int argc, char *argv[]) warn_msg("Unable to retrieve file size\n"); HDassert(iter.filesize != 0); - /* Get storge info for file-level structures */ + /* Get storage info for file-level structures */ if (H5Fget_info2(fid, &finfo) < 0) warn_msg("Unable to retrieve file info\n"); else { |