summaryrefslogtreecommitdiffstats
path: root/tools/h5dump/h5dump.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2013-06-26 21:04:20 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2013-06-26 21:04:20 (GMT)
commit308106c0e96f3d991d804194a83c231f0a98ba2a (patch)
tree381cd204544d8c7c80db2996c6b4df12237e09e2 /tools/h5dump/h5dump.c
parentc2750822ffd92d78e9c442e8ab046ac2dbf47d8e (diff)
downloadhdf5-308106c0e96f3d991d804194a83c231f0a98ba2a.zip
hdf5-308106c0e96f3d991d804194a83c231f0a98ba2a.tar.gz
hdf5-308106c0e96f3d991d804194a83c231f0a98ba2a.tar.bz2
[svn-r23829] HDFFV-8134: allow exclusion of attributes. This implements the technique and creates a test. Help changes will be added after trunk tests pass the test cycle.
Tested: local linux
Diffstat (limited to 'tools/h5dump/h5dump.c')
-rw-r--r--tools/h5dump/h5dump.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index ef979b2..225bc9a 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -71,7 +71,7 @@ struct handler_t {
*/
/* The following initialization makes use of C language cancatenating */
/* "xxx" "yyy" into "xxxyyy". */
-static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:Aq:z:m:RECM:O*";
+static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:A*q:z:m:RECM:O*";
static struct long_options l_opts[] = {
{ "help", no_arg, 'h' },
{ "hel", no_arg, 'h' },
@@ -175,7 +175,7 @@ static struct long_options l_opts[] = {
{ "xml-n", require_arg, 'X' },
{ "xml", no_arg, 'x' },
{ "xm", no_arg, 'x' },
- { "onlyattr", no_arg, 'A' },
+ { "onlyattr", optional_arg, 'A' },
{ "escape", no_arg, 'e' },
{ "noindex", no_arg, 'y' },
{ "binary", optional_arg, 'b' },
@@ -1093,9 +1093,14 @@ parse_start:
last_was_dset = FALSE;
break;
case 'A':
- display_data = FALSE;
- display_attr_data = TRUE;
- last_was_dset = FALSE;
+ if ( opt_arg != NULL) {
+ if(0 == HDatoi(opt_arg)) include_attrs = FALSE;
+ }
+ else {
+ display_data = FALSE;
+ display_attr_data = TRUE;
+ last_was_dset = FALSE;
+ }
break;
case 'i':
display_oid = TRUE;