summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/misc/h5stat.c14
-rw-r--r--tools/misc/testh5stat.sh.in11
2 files changed, 23 insertions, 2 deletions
diff --git a/tools/misc/h5stat.c b/tools/misc/h5stat.c
index db93471..a396472 100644
--- a/tools/misc/h5stat.c
+++ b/tools/misc/h5stat.c
@@ -101,7 +101,7 @@ static int display_dset = FALSE;
static int display_dtype_metadata = FALSE;
static int display_dtype = FALSE;
-static const char *s_opts ="FfhGgDdT";
+static const char *s_opts ="FfhGgDdTV";
static struct long_options l_opts[] = {
{"help", no_arg, 'h'},
{"hel", no_arg, 'h'},
@@ -149,6 +149,12 @@ static struct long_options l_opts[] = {
{"dtypeme", no_arg, 'T'},
{"dtypem", no_arg, 'T'},
{"dtype", no_arg, 'T'},
+ { "version", no_arg, 'V' },
+ { "versio", no_arg, 'V' },
+ { "versi", no_arg, 'V' },
+ { "vers", no_arg, 'V' },
+ { "ver", no_arg, 'V' },
+ { "ve", no_arg, 'V' },
{ NULL, 0, '\0' }
};
@@ -174,6 +180,7 @@ static void
fprintf(stdout, "\n");
fprintf(stdout, " OPTIONS\n");
fprintf(stdout, " -h, --help Print a usage message and exit\n");
+ fprintf(stdout, " -V, --version Print version number and exit\n");
fprintf(stdout, " -f, --file Print file information\n");
fprintf(stdout, " -F, --filemetadata Print file metadata\n");
fprintf(stdout, " -g, --group Print group information\n");
@@ -659,6 +666,11 @@ parse_start:
case 'h':
usage(progname);
leave(EXIT_SUCCESS);
+ case 'V':
+ print_version(progname);
+ leave(EXIT_SUCCESS);
+ break;
+
default:
usage(progname);
leave(EXIT_FAILURE);
diff --git a/tools/misc/testh5stat.sh.in b/tools/misc/testh5stat.sh.in
index 1981f7b..0857b3c 100644
--- a/tools/misc/testh5stat.sh.in
+++ b/tools/misc/testh5stat.sh.in
@@ -106,9 +106,18 @@ SKIP() {
##############################################################################
##############################################################################
-# test for help flag
+# Test for help flag
TOOLTEST h5stat_help1.ddl -h
TOOLTEST h5stat_help2.ddl --help
+
+# Test file with groups, compressed datasets, user-applied fileters, etc.
+# h5stat_filters.h5 is a copy of ../../testfiles/tfilters.h5 as of release 1.8.0-alpha4
+TOOLTEST h5stat_filters.ddl h5stat_filters.h5
+TOOLTEST h5stat_filters-f.ddl -f h5stat_filters.h5
+TOOLTEST h5stat_filters-F.ddl -F h5stat_filters.h5
+TOOLTEST h5stat_filters-d.ddl -d h5stat_filters.h5
+TOOLTEST h5stat_filters-g.ddl -g h5stat_filters.h5
+TOOLTEST h5stat_filters-dT.ddl -dT h5stat_filters.h5
echo