diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2012-07-12 20:30:30 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2012-07-12 20:30:30 (GMT) |
commit | 210d04b05f1ea3a172acf531519a36ee39c982b3 (patch) | |
tree | 62bb19366bb46b2c417130d10a6e91d1b8b735ae /tools/h5dump/h5dump.c | |
parent | 1942f47bcfa0739e97efba02197136e1ecbb4a29 (diff) | |
download | hdf5-210d04b05f1ea3a172acf531519a36ee39c982b3.zip hdf5-210d04b05f1ea3a172acf531519a36ee39c982b3.tar.gz hdf5-210d04b05f1ea3a172acf531519a36ee39c982b3.tar.bz2 |
[svn-r22567] HDFFV-7784: add attributes to the list of file contents option for h5dump. This is accomplished by adding an optional value to the option (-n)
Created test and reference files.
Tested: local linux with cmake
Diffstat (limited to 'tools/h5dump/h5dump.c')
-rw-r--r-- | tools/h5dump/h5dump.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index cd52743..15d862e 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -71,11 +71,11 @@ struct handler_t { */ /* The following initialization makes use of C language cancatenating */ /* "xxx" "yyy" into "xxxyyy". */ -static const char *s_opts = "hnpeyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o:b*F:s:S:Aq:z:m:RECM:"; +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:"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "hel", no_arg, 'h' }, - { "contents", no_arg, 'n' }, + { "contents", optional_arg, 'n' }, { "properties", no_arg, 'p' }, { "boot-block", no_arg, 'B' }, { "boot-bloc", no_arg, 'B' }, @@ -235,6 +235,7 @@ usage(const char *prog) HDfprintf(rawoutstream, " OPTIONS\n"); HDfprintf(rawoutstream, " -h, --help Print a usage message and exit\n"); HDfprintf(rawoutstream, " -n, --contents Print a list of the file contents and exit\n"); + HDfprintf(rawoutstream, " Optional value 1 also prints attributes.\n"); HDfprintf(rawoutstream, " -B, --superblock Print the content of the super block\n"); HDfprintf(rawoutstream, " -H, --header Print the header only; no data is displayed\n"); HDfprintf(rawoutstream, " -A, --onlyattr Print the header and value of attributes\n"); @@ -999,6 +1000,9 @@ parse_start: case 'n': display_fi = TRUE; last_was_dset = FALSE; + if ( opt_arg != NULL) { + h5trav_set_verbose(HDatoi(opt_arg)); + } break; case 'p': display_dcpl = TRUE; |