diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2017-03-29 21:44:23 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2017-03-29 21:44:23 (GMT) |
commit | ba2cfde1fda880bf9d4b18dd439100ee5c4680bb (patch) | |
tree | b071863eb782a1ad32e161a60197f33e30cdf5be /tools/h5ls | |
parent | 096aac122ed6b6e8d07a30330bd95992887cd2be (diff) | |
download | hdf5-ba2cfde1fda880bf9d4b18dd439100ee5c4680bb.zip hdf5-ba2cfde1fda880bf9d4b18dd439100ee5c4680bb.tar.gz hdf5-ba2cfde1fda880bf9d4b18dd439100ee5c4680bb.tar.bz2 |
Merge/port changes from develop back to 1.8 for tools and cmake
Diffstat (limited to 'tools/h5ls')
-rw-r--r-- | tools/h5ls/CMakeTests.cmake | 8 | ||||
-rw-r--r-- | tools/h5ls/h5ls.c | 122 |
2 files changed, 64 insertions, 66 deletions
diff --git a/tools/h5ls/CMakeTests.cmake b/tools/h5ls/CMakeTests.cmake index 2addebf..f88ecf4 100644 --- a/tools/h5ls/CMakeTests.cmake +++ b/tools/h5ls/CMakeTests.cmake @@ -109,7 +109,7 @@ ############################################################################## ############################################################################## - MACRO (ADD_H5_TEST resultfile resultcode) + macro (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5LS-${resultfile} COMMAND $<TARGET_FILE:h5ls> ${ARGN}) @@ -133,9 +133,9 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () - ENDMACRO () + endmacro () - MACRO (ADD_H5_UD_TEST testname resultcode resultfile) + macro (ADD_H5_UD_TEST testname resultcode resultfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( @@ -160,7 +160,7 @@ ) set_tests_properties (H5LS_UD-${testname} PROPERTIES DEPENDS H5LS_UD-${testname}-clearall-objects) endif () - ENDMACRO () + endmacro () ############################################################################## ############################################################################## diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 4ab4f22..452f307 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -177,66 +177,65 @@ static herr_t visit_obj(hid_t file, const char *oname, iter_t *iter); static void usage (void) { - HDfprintf(rawerrorstream, "\ -usage: %s [OPTIONS] file[/OBJECT] [file[/[OBJECT]...]\n\ - OPTIONS\n\ - -h, -?, --help Print a usage message and exit\n\ - -a, --address Print raw data address. If dataset is contiguous, address\n\ - is offset in file of beginning of raw data. If chunked,\n\ - returned list of addresses indicates offset of each chunk.\n\ - Must be used with -v, --verbose option.\n\ - Provides no information for non-dataset objects.\n\ - -d, --data Print the values of datasets\n\ - --enable-error-stack\n\ - Prints messages from the HDF5 error stack as they occur.\n\ - --follow-symlinks\n\ - Follow symbolic links (soft links and external links)\n\ - to display target object information.\n\ - Without this option, h5ls identifies a symbolic link\n\ - as a soft link or external link and prints the value\n\ - assigned to the symbolic link; it does not provide any\n\ - information regarding the target object or determine\n\ - whether the link is a dangling link.\n\ - --no-dangling-links\n\ - Must be used with --follow-symlinks option;\n\ - otherwise, h5ls shows error message and returns an exit\n\ - code of 1. \n\ - Check for any symbolic links (soft links or external links)\n\ - that do not resolve to an existing object (dataset, group,\n\ - or named datatype).\n\ - If any dangling link is found, this situation is treated\n\ - as an error and h5ls returns an exit code of 1.\n\ - -f, --full Print full path names instead of base names\n\ - -g, --group Show information about a group, not its contents\n\ - -l, --label Label members of compound datasets\n\ - -r, --recursive List all groups recursively, avoiding cycles\n\ - -s, --string Print 1-byte integer datasets as ASCII\n\ - -S, --simple Use a machine-readable output format\n\ - -wN, --width=N Set the number of columns of output\n\ - -v, --verbose Generate more verbose output\n\ - -V, --version Print version number and exit\n\ - --vfd=DRIVER Use the specified virtual file driver\n\ - -x, --hexdump Show raw data in hexadecimal format\n\ -\n\ - file/OBJECT\n\ - Each object consists of an HDF5 file name optionally followed by a\n\ - slash and an object name within the file (if no object is specified\n\ - within the file then the contents of the root group are displayed).\n\ - The file name may include a printf(3C) integer format such as\n\ - \"%%05d\" to open a file family.\n\ -\n\ - Deprecated Options\n\ - The following options have been deprecated in HDF5. While they remain\n\ - available, they have been superseded as indicated and may be removed\n\ - from HDF5 in the future. Use the indicated replacement option in all\n\ - new work; where possible, existing scripts, et cetera, should also be\n\ - updated to use the replacement option.\n\ -\n\ - -E or --external Follow external links.\n\ - Replaced by --follow-symlinks.\n\ - -e, --errors Show all HDF5 error reporting\n\ - Replaced by --enable-error-stack.\n", - h5tools_getprogname()); + FLUSHSTREAM(rawoutstream); + PRINTVALSTREAM(rawoutstream, "usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...]\n"); + PRINTVALSTREAM(rawoutstream, " OPTIONS\n"); + PRINTVALSTREAM(rawoutstream, " -h, -?, --help Print a usage message and exit\n"); + PRINTVALSTREAM(rawoutstream, " -a, --address Print raw data address. If dataset is contiguous, address\n"); + PRINTVALSTREAM(rawoutstream, " is offset in file of beginning of raw data. If chunked,\n"); + PRINTVALSTREAM(rawoutstream, " returned list of addresses indicates offset of each chunk.\n"); + PRINTVALSTREAM(rawoutstream, " Must be used with -v, --verbose option.\n"); + PRINTVALSTREAM(rawoutstream, " Provides no information for non-dataset objects.\n"); + PRINTVALSTREAM(rawoutstream, " -d, --data Print the values of datasets\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)\n"); + PRINTVALSTREAM(rawoutstream, " to display target object information.\n"); + PRINTVALSTREAM(rawoutstream, " Without this option, h5ls identifies a symbolic link\n"); + PRINTVALSTREAM(rawoutstream, " as a soft link or external link and prints the value\n"); + PRINTVALSTREAM(rawoutstream, " assigned to the symbolic link; it does not provide any\n"); + PRINTVALSTREAM(rawoutstream, " information regarding the target object or determine\n"); + PRINTVALSTREAM(rawoutstream, " whether the link is a dangling link.\n"); + PRINTVALSTREAM(rawoutstream, " --no-dangling-links\n"); + PRINTVALSTREAM(rawoutstream, " Must be used with --follow-symlinks option;\n"); + PRINTVALSTREAM(rawoutstream, " otherwise, h5ls shows error message and returns an exit\n"); + PRINTVALSTREAM(rawoutstream, " code of 1. \n"); + PRINTVALSTREAM(rawoutstream, " Check for any symbolic links (soft links or external links)\n"); + PRINTVALSTREAM(rawoutstream, " that do not resolve to an existing object (dataset, group,\n"); + PRINTVALSTREAM(rawoutstream, " or named datatype).\n"); + PRINTVALSTREAM(rawoutstream, " If any dangling link is found, this situation is treated\n"); + PRINTVALSTREAM(rawoutstream, " as an error and h5ls returns an exit code of 1.\n"); + PRINTVALSTREAM(rawoutstream, " -f, --full Print full path names instead of base names\n"); + PRINTVALSTREAM(rawoutstream, " -g, --group Show information about a group, not its contents\n"); + PRINTVALSTREAM(rawoutstream, " -l, --label Label members of compound datasets\n"); + PRINTVALSTREAM(rawoutstream, " -r, --recursive List all groups recursively, avoiding cycles\n"); + PRINTVALSTREAM(rawoutstream, " -s, --string Print 1-byte integer datasets as ASCII\n"); + PRINTVALSTREAM(rawoutstream, " -S, --simple Use a machine-readable output format\n"); + PRINTVALSTREAM(rawoutstream, " -wN, --width=N Set the number of columns of output\n"); + PRINTVALSTREAM(rawoutstream, " -v, --verbose Generate more verbose output\n"); + PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n"); + PRINTVALSTREAM(rawoutstream, " --vfd=DRIVER Use the specified virtual file driver\n"); + PRINTVALSTREAM(rawoutstream, " -x, --hexdump Show raw data in hexadecimal format\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " file/OBJECT\n"); + PRINTVALSTREAM(rawoutstream, " Each object consists of an HDF5 file name optionally followed by a\n"); + PRINTVALSTREAM(rawoutstream, " slash and an object name within the file (if no object is specified\n"); + PRINTVALSTREAM(rawoutstream, " within the file then the contents of the root group are displayed).\n"); + PRINTVALSTREAM(rawoutstream, " The file name may include a printf(3C) integer format such as\n"); + PRINTVALSTREAM(rawoutstream, " \"%%05d\" to open a file family.\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " Deprecated Options\n"); + PRINTVALSTREAM(rawoutstream, " The following options have been deprecated in HDF5. While they remain\n"); + PRINTVALSTREAM(rawoutstream, " available, they have been superseded as indicated and may be removed\n"); + PRINTVALSTREAM(rawoutstream, " from HDF5 in the future. Use the indicated replacement option in all\n"); + PRINTVALSTREAM(rawoutstream, " new work; where possible, existing scripts, et cetera, should also be\n"); + PRINTVALSTREAM(rawoutstream, " updated to use the replacement option.\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " -E or --external Follow external links.\n"); + PRINTVALSTREAM(rawoutstream, " Replaced by --follow-symlinks.\n"); + PRINTVALSTREAM(rawoutstream, " -e, --errors Show all HDF5 error reporting\n"); + PRINTVALSTREAM(rawoutstream, " Replaced by --enable-error-stack.\n"); } @@ -2795,9 +2794,8 @@ main(int argc, const char *argv[]) file = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, preferred_driver, drivername, sizeof drivername); if(file >= 0) { - if(verbose_g) { + if(verbose_g) PRINTSTREAM(rawoutstream, "Opened \"%s\" with %s driver.\n", fname, drivername); - } break; /*success*/ } /* end if */ |