diff options
author | Jonathan Kim <jkm@hdfgroup.org> | 2010-11-09 21:32:26 (GMT) |
---|---|---|
committer | Jonathan Kim <jkm@hdfgroup.org> | 2010-11-09 21:32:26 (GMT) |
commit | 3b7a375179f7f32850780409ad46e08c53c04936 (patch) | |
tree | 314a707fca6eaddc5b7463cabbdca37d85dd56b6 /tools/h5ls | |
parent | f5c14780ca04def5c377728ff48c6cd3737d0aba (diff) | |
download | hdf5-3b7a375179f7f32850780409ad46e08c53c04936.zip hdf5-3b7a375179f7f32850780409ad46e08c53c04936.tar.gz hdf5-3b7a375179f7f32850780409ad46e08c53c04936.tar.bz2 |
[svn-r19752] Purpose:
Fixed Bug# 1979 Output from h5ls -rdlS on nested compound datatypes is
difficult to parse.
Description:
Update to add curly brackets for the nested compound members, when
S (--simple) option is used with -l (--label), so user can tell
which members blong to which compound type.
Merged from hdf5 trunk r19751.
Tested:
jam (linux32-LE), amani (linux64-LE)
Diffstat (limited to 'tools/h5ls')
-rw-r--r-- | tools/h5ls/CMakeLists.txt | 15 | ||||
-rw-r--r-- | tools/h5ls/h5ls.c | 12 | ||||
-rw-r--r-- | tools/h5ls/testh5ls.sh.in | 6 |
3 files changed, 31 insertions, 2 deletions
diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index c81f42b..149e69f 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -72,6 +72,9 @@ IF (BUILD_TESTING) thlink-1.ls tloop-1.ls tnestcomp-1.ls + tnestcomp-2.ls + tnestcomp-3.ls + tnestcomp-4.ls tsaf.ls tslink-1.ls tstr-1.ls @@ -240,6 +243,12 @@ IF (BUILD_TESTING) tloop-1.out.err tnestcomp-1.out tnestcomp-1.out.err + tnestcomp-2.out + tnestcomp-2.out.err + tnestcomp-3.out + tnestcomp-3.out.err + tnestcomp-4.out + tnestcomp-4.out.err tsaf.out tsaf.out.err tslink-1.out @@ -325,6 +334,12 @@ IF (BUILD_TESTING) #test for the nested compound type ADD_H5_TEST (tnestcomp-1 0 -w80 -r -d tnestedcomp.h5) + ADD_H5_TEST (tnestcomp-2 0 -w80 -r -d -S tnestedcomp.h5) + + ADD_H5_TEST (tnestcomp-3 0 -w80 -r -d -l tnestedcomp.h5) + + ADD_H5_TEST (tnestcomp-4 0 -w80 -r -d -l -S tnestedcomp.h5) + # test for loop detection ADD_H5_TEST (tloop-1 0 -w80 -r -d tloop.h5) diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index b1d9ee9..b74d525 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -1263,8 +1263,16 @@ dump_dataset_values(hid_t dset) info.arr_suf = ""; info.arr_sep = " "; - info.cmpd_pre = ""; - info.cmpd_suf = ""; + if (label_g) + { + info.cmpd_pre = "{"; + info.cmpd_suf = "}"; + } + else + { + info.cmpd_pre = ""; + info.cmpd_suf = ""; + } info.cmpd_sep = " "; if (label_g) info.cmpd_name = "%s="; diff --git a/tools/h5ls/testh5ls.sh.in b/tools/h5ls/testh5ls.sh.in index 642241f..a996401 100644 --- a/tools/h5ls/testh5ls.sh.in +++ b/tools/h5ls/testh5ls.sh.in @@ -188,6 +188,12 @@ TOOLTEST tcomp-1.ls 0 -w80 -r -d tcompound.h5 #test for the nested compound type TOOLTEST tnestcomp-1.ls 0 -w80 -r -d tnestedcomp.h5 +TOOLTEST tnestcomp-2.ls 0 -w80 -r -d -S tnestedcomp.h5 + +TOOLTEST tnestcomp-3.ls 0 -w80 -r -d -l tnestedcomp.h5 + +TOOLTEST tnestcomp-4.ls 0 -w80 -r -d -l -S tnestedcomp.h5 + # test for loop detection TOOLTEST tloop-1.ls 0 -w80 -r -d tloop.h5 |