summaryrefslogtreecommitdiffstats
path: root/tools/h5dump/h5dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5dump/h5dump.c')
-rw-r--r--tools/h5dump/h5dump.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index d89202c..9b304bd 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -30,7 +30,7 @@ static const char *xml_dtd_uri = NULL;
/* module-scoped variables for XML option */
#define DEFAULT_XSD "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"
-#define DEFAULT_DTD "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.dtd"
+#define DEFAULT_DTD "http://www.hdfgroup.org/HDF5/XML/DTD/HDF5-File.dtd"
/* Standard DDL output */
static const dump_functions ddl_function_table = {
@@ -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;
@@ -1649,7 +1650,7 @@ main(int argc, const char *argv[])
indx = HDstrrchr(ns,(int)':');
if (indx) *indx = '\0';
- PRINTSTREAM(rawoutstream, "<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File\" "
+ PRINTSTREAM(rawoutstream, "<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\" "
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
"xsi:schemaLocation=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File "
"http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\">\n",xmlnsprefix,ns);