summaryrefslogtreecommitdiffstats
path: root/tools/h5dump/h5dump.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2013-07-15 15:53:17 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2013-07-15 15:53:17 (GMT)
commitf6ffaf1f69b71caf958c8d71ea1decc5ea696b03 (patch)
treebac59b0037c12d4afdf53877c4704b9c6db3a6ac /tools/h5dump/h5dump.c
parenta3a410b643b56463359732f384d215e1cb673384 (diff)
downloadhdf5-f6ffaf1f69b71caf958c8d71ea1decc5ea696b03.zip
hdf5-f6ffaf1f69b71caf958c8d71ea1decc5ea696b03.tar.gz
hdf5-f6ffaf1f69b71caf958c8d71ea1decc5ea696b03.tar.bz2
[svn-r23898] HDFFV-8476: Add optional arg to -A for excluding attributes.
Merged from trunk. Tested: local linux
Diffstat (limited to 'tools/h5dump/h5dump.c')
-rw-r--r--tools/h5dump/h5dump.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index ef979b2..9b304bd 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' },
@@ -221,11 +221,6 @@ leave(int ret)
* Purpose: Print the usage message about dumper
*
* Return: void
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications:
- * Pedro Vicente, October 5, 2007. Add -q and -z flags
*-------------------------------------------------------------------------
*/
static void
@@ -240,6 +235,7 @@ usage(const char *prog)
PRINTVALSTREAM(rawoutstream, " -B, --superblock Print the content of the super block\n");
PRINTVALSTREAM(rawoutstream, " -H, --header Print the header only; no data is displayed\n");
PRINTVALSTREAM(rawoutstream, " -A, --onlyattr Print the header and value of attributes\n");
+ PRINTVALSTREAM(rawoutstream, " Optional value 0 suppresses printing attributes.\n");
PRINTVALSTREAM(rawoutstream, " -i, --object-ids Print the object ids\n");
PRINTVALSTREAM(rawoutstream, " -r, --string Print 1-byte integer datasets as ASCII\n");
PRINTVALSTREAM(rawoutstream, " -e, --escape Escape non printing characters\n");
@@ -1093,9 +1089,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;