summaryrefslogtreecommitdiffstats
path: root/tools/src
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2021-01-19 22:39:23 (GMT)
committerGitHub <noreply@github.com>2021-01-19 22:39:23 (GMT)
commita0ee1eb5dc7ad3f45860eb5ea0791a4380302ddf (patch)
tree1a88b6615ef1e6f281ce4e34c66c393a3193f5e2 /tools/src
parenta63a1c8a57bd313a0f63c3f39fc18965500c304f (diff)
downloadhdf5-a0ee1eb5dc7ad3f45860eb5ea0791a4380302ddf.zip
hdf5-a0ee1eb5dc7ad3f45860eb5ea0791a4380302ddf.tar.gz
hdf5-a0ee1eb5dc7ad3f45860eb5ea0791a4380302ddf.tar.bz2
1 12 merge of changes from dev (#271)
* OESS-98 fix tools test for plugins * sync fork * Merge of changes from dev * Move problem option to bottom of the list until fixed * HDFFV-11106 - fix parsing optional args * HDFFV-11106 add note * grammer fix
Diffstat (limited to 'tools/src')
-rw-r--r--tools/src/h5diff/h5diff_common.c30
-rw-r--r--tools/src/h5dump/h5dump.c132
-rw-r--r--tools/src/h5dump/h5dump.h2
-rw-r--r--tools/src/h5dump/h5dump_extern.h2
-rw-r--r--tools/src/h5repack/h5repack_main.c1
-rw-r--r--tools/src/misc/h5debug.c3
6 files changed, 81 insertions, 89 deletions
diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c
index 95245bd..5646e2a 100644
--- a/tools/src/h5diff/h5diff_common.c
+++ b/tools/src/h5diff/h5diff_common.c
@@ -25,7 +25,7 @@ static int check_d_input(const char *);
* Command-line options: The user can specify short or long-named
* parameters.
*/
-static const char * s_opts = "hVrv:qn:d:p:NcelxE:A:S";
+static const char * s_opts = "hVrv*qn:d:p:NcelxE:A:S";
static struct long_options l_opts[] = {{"help", no_arg, 'h'},
{"version", no_arg, 'V'},
{"report", no_arg, 'r'},
@@ -253,33 +253,27 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
case 'v':
opts->mode_verbose = 1;
- /* This for loop is for handling style like
- * -v, -v1, --verbose, --verbose=1.
- */
for (i = 1; i < argc; i++) {
/*
- * short opt
+ * special check for short opt
*/
- if (!strcmp(argv[i], "-v")) { /* no arg */
- opt_ind--;
+ if (!strcmp(argv[i], "-v")) {
+ if (opt_arg != NULL)
+ opt_ind--;
opts->mode_verbose_level = 0;
break;
}
else if (!strncmp(argv[i], "-v", (size_t)2)) {
+ if (opt_arg != NULL)
+ opt_ind--;
opts->mode_verbose_level = atoi(&argv[i][2]);
break;
}
-
- /*
- * long opt
- */
- if (!strcmp(argv[i], "--verbose")) { /* no arg */
- opts->mode_verbose_level = 0;
- break;
- }
- else if (!strncmp(argv[i], "--verbose", (size_t)9) && argv[i][9] == '=') {
- opts->mode_verbose_level = atoi(&argv[i][10]);
- break;
+ else {
+ if (opt_arg != NULL)
+ opts->mode_verbose_level = HDatoi(opt_arg);
+ else
+ opts->mode_verbose_level = 0;
}
}
break;
diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c
index 34b3c10..1429842 100644
--- a/tools/src/h5dump/h5dump.c
+++ b/tools/src/h5dump/h5dump.c
@@ -80,39 +80,8 @@ struct handler_t {
*/
/* The following initialization makes use of C language concatenating */
/* "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:A*q:z:m:RE*CM:O*N:vG:";
-static struct long_options l_opts[] = {{"help", no_arg, 'h'},
- {"hel", no_arg, 'h'},
- {"contents", optional_arg, 'n'},
- {"properties", no_arg, 'p'},
- {"superblock", no_arg, 'B'},
- {"boot-block", no_arg, 'B'},
- {"boot-bloc", no_arg, 'B'},
- {"boot-blo", no_arg, 'B'},
- {"boot-bl", no_arg, 'B'},
- {"boot-b", no_arg, 'B'},
- {"boot", no_arg, 'B'},
- {"boo", no_arg, 'B'},
- {"bo", no_arg, 'B'},
- {"header", no_arg, 'H'},
- {"heade", no_arg, 'H'},
- {"head", no_arg, 'H'},
- {"hea", no_arg, 'H'},
- {"object-ids", no_arg, 'i'},
- {"object-id", no_arg, 'i'},
- {"object-i", no_arg, 'i'},
- {"object", no_arg, 'i'},
- {"objec", no_arg, 'i'},
- {"obje", no_arg, 'i'},
- {"obj", no_arg, 'i'},
- {"ob", no_arg, 'i'},
- {"version", no_arg, 'V'},
- {"versio", no_arg, 'V'},
- {"versi", no_arg, 'V'},
- {"vers", no_arg, 'V'},
- {"ver", no_arg, 'V'},
- {"ve", no_arg, 'V'},
- {"attribute", require_arg, 'a'},
+static const char * s_opts = "a:b*c:d:ef:g:hik:l:m:n*o*pq:rs:t:uvw:xyz:A*BCD:E*F:G:HM:N:O*RS:VX:";
+static struct long_options l_opts[] = {{"attribute", require_arg, 'a'},
{"attribut", require_arg, 'a'},
{"attribu", require_arg, 'a'},
{"attrib", require_arg, 'a'},
@@ -120,10 +89,7 @@ static struct long_options l_opts[] = {{"help", no_arg, 'h'},
{"attr", require_arg, 'a'},
{"att", require_arg, 'a'},
{"at", require_arg, 'a'},
- {"block", require_arg, 'k'},
- {"bloc", require_arg, 'k'},
- {"blo", require_arg, 'k'},
- {"bl", require_arg, 'k'},
+ {"binary", optional_arg, 'b'},
{"count", require_arg, 'c'},
{"coun", require_arg, 'c'},
{"cou", require_arg, 'c'},
@@ -131,10 +97,7 @@ static struct long_options l_opts[] = {{"help", no_arg, 'h'},
{"dataset", require_arg, 'd'},
{"datase", require_arg, 'd'},
{"datas", require_arg, 'd'},
- {"datatype", require_arg, 't'},
- {"datatyp", require_arg, 't'},
- {"dataty", require_arg, 't'},
- {"datat", require_arg, 't'},
+ {"escape", no_arg, 'e'},
{"filedriver", require_arg, 'f'},
{"filedrive", require_arg, 'f'},
{"filedriv", require_arg, 'f'},
@@ -148,24 +111,44 @@ static struct long_options l_opts[] = {{"help", no_arg, 'h'},
{"grou", require_arg, 'g'},
{"gro", require_arg, 'g'},
{"gr", require_arg, 'g'},
- {"output", optional_arg, 'o'},
- {"outpu", optional_arg, 'o'},
- {"outp", optional_arg, 'o'},
- {"out", optional_arg, 'o'},
- {"ou", optional_arg, 'o'},
+ {"help", no_arg, 'h'},
+ {"hel", no_arg, 'h'},
+ {"object-ids", no_arg, 'i'},
+ {"object-id", no_arg, 'i'},
+ {"object-i", no_arg, 'i'},
+ {"object", no_arg, 'i'},
+ {"objec", no_arg, 'i'},
+ {"obje", no_arg, 'i'},
+ {"obj", no_arg, 'i'},
+ {"ob", no_arg, 'i'},
+ {"block", require_arg, 'k'},
+ {"bloc", require_arg, 'k'},
+ {"blo", require_arg, 'k'},
+ {"bl", require_arg, 'k'},
{"soft-link", require_arg, 'l'},
{"soft-lin", require_arg, 'l'},
{"soft-li", require_arg, 'l'},
{"soft-l", require_arg, 'l'},
{"soft", require_arg, 'l'},
{"sof", require_arg, 'l'},
+ {"format", require_arg, 'm'},
+ {"contents", optional_arg, 'n'},
+ {"output", optional_arg, 'o'},
+ {"outpu", optional_arg, 'o'},
+ {"outp", optional_arg, 'o'},
+ {"out", optional_arg, 'o'},
+ {"ou", optional_arg, 'o'},
+ {"properties", no_arg, 'p'},
+ {"sort_by", require_arg, 'q'},
+ {"string", no_arg, 'r'},
+ {"strin", no_arg, 'r'},
{"start", require_arg, 's'},
{"star", require_arg, 's'},
{"sta", require_arg, 's'},
- {"stride", require_arg, 'S'},
- {"strid", require_arg, 'S'},
- {"string", no_arg, 'r'},
- {"strin", no_arg, 'r'},
+ {"datatype", require_arg, 't'},
+ {"datatyp", require_arg, 't'},
+ {"dataty", require_arg, 't'},
+ {"datat", require_arg, 't'},
{"use-dtd", no_arg, 'u'},
{"use-dt", no_arg, 'u'},
{"use-d", no_arg, 'u'},
@@ -173,33 +156,50 @@ static struct long_options l_opts[] = {{"help", no_arg, 'h'},
{"use", no_arg, 'u'},
{"us", no_arg, 'u'},
{"u", no_arg, 'u'},
+ {"vds-view-first-missing", no_arg, 'v'},
{"width", require_arg, 'w'},
{"widt", require_arg, 'w'},
{"wid", require_arg, 'w'},
{"wi", require_arg, 'w'},
- {"xml-dtd", require_arg, 'D'},
- {"xml-dt", require_arg, 'D'},
- {"xml-d", require_arg, 'D'},
- {"xml-ns", require_arg, 'X'},
- {"xml-n", require_arg, 'X'},
{"xml", no_arg, 'x'},
{"xm", no_arg, 'x'},
- {"onlyattr", optional_arg, 'A'},
- {"escape", no_arg, 'e'},
{"noindex", no_arg, 'y'},
- {"binary", optional_arg, 'b'},
- {"form", require_arg, 'F'},
- {"sort_by", require_arg, 'q'},
{"sort_order", require_arg, 'z'},
- {"format", require_arg, 'm'},
- {"region", no_arg, 'R'},
+ {"onlyattr", optional_arg, 'A'},
+ {"superblock", no_arg, 'B'},
+ {"boot-block", no_arg, 'B'},
+ {"boot-bloc", no_arg, 'B'},
+ {"boot-blo", no_arg, 'B'},
+ {"boot-bl", no_arg, 'B'},
+ {"boot-b", no_arg, 'B'},
+ {"boot", no_arg, 'B'},
+ {"boo", no_arg, 'B'},
+ {"bo", no_arg, 'B'},
+ {"no-compact-subset", no_arg, 'C'},
+ {"xml-dtd", require_arg, 'D'},
+ {"xml-dt", require_arg, 'D'},
+ {"xml-d", require_arg, 'D'},
{"enable-error-stack", optional_arg, 'E'},
+ {"form", require_arg, 'F'},
+ {"vds-gap-size", require_arg, 'G'},
+ {"header", no_arg, 'H'},
+ {"heade", no_arg, 'H'},
+ {"head", no_arg, 'H'},
+ {"hea", no_arg, 'H'},
{"packed-bits", require_arg, 'M'},
- {"no-compact-subset", no_arg, 'C'},
- {"ddl", optional_arg, 'O'},
{"any_path", require_arg, 'N'},
- {"vds-view-first-missing", no_arg, 'v'},
- {"vds-gap-size", require_arg, 'G'},
+ {"ddl", optional_arg, 'O'},
+ {"region", no_arg, 'R'},
+ {"stride", require_arg, 'S'},
+ {"strid", require_arg, 'S'},
+ {"version", no_arg, 'V'},
+ {"versio", no_arg, 'V'},
+ {"versi", no_arg, 'V'},
+ {"vers", no_arg, 'V'},
+ {"ver", no_arg, 'V'},
+ {"ve", no_arg, 'V'},
+ {"xml-ns", require_arg, 'X'},
+ {"xml-n", require_arg, 'X'},
{"s3-cred", require_arg, '$'},
{"hdfs-attrs", require_arg, '#'},
{"vol-value", require_arg, '1'},
diff --git a/tools/src/h5dump/h5dump.h b/tools/src/h5dump/h5dump.h
index b4198ad..9392ca3 100644
--- a/tools/src/h5dump/h5dump.h
+++ b/tools/src/h5dump/h5dump.h
@@ -83,7 +83,7 @@ typedef struct {
dump_opt_t dump_opts = {TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE,
TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, 0};
-#define PACKED_BITS_MAX 8 /* Maximum number of packed-bits to display */
+#define PACKED_BITS_MAX 8 /* Maximum number of packed-bits to display */
#define PACKED_BITS_SIZE_MAX (8 * sizeof(long long)) /* Maximum bits size of integer types of packed-bits */
/* mask list for packed bits */
unsigned long long packed_mask[PACKED_BITS_MAX]; /* packed bits are restricted to 8*sizeof(llong) bytes */
diff --git a/tools/src/h5dump/h5dump_extern.h b/tools/src/h5dump/h5dump_extern.h
index 6ccd159..56734cf 100644
--- a/tools/src/h5dump/h5dump_extern.h
+++ b/tools/src/h5dump/h5dump_extern.h
@@ -80,7 +80,7 @@ typedef struct {
} dump_opt_t;
extern dump_opt_t dump_opts;
-#define PACKED_BITS_MAX 8 /* Maximum number of packed-bits to display */
+#define PACKED_BITS_MAX 8 /* Maximum number of packed-bits to display */
#define PACKED_BITS_SIZE_MAX 8 * sizeof(long long) /* Maximum bits size of integer types of packed-bits */
/* mask list for packed bits */
extern unsigned long long
diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c
index c38dd66..a67d6ac 100644
--- a/tools/src/h5repack/h5repack_main.c
+++ b/tools/src/h5repack/h5repack_main.c
@@ -262,6 +262,7 @@ usage(const char *prog)
PRINTVALSTREAM(rawoutstream,
" Required values: filter_number, filter_flag, cd_value_count, value1\n");
PRINTVALSTREAM(rawoutstream, " Optional values: value2 to valueN\n");
+ PRINTVALSTREAM(rawoutstream, " filter_flag: 1 is OPTIONAL or 0 is MANDATORY\n");
PRINTVALSTREAM(rawoutstream, " NONE (no parameter)\n");
PRINTVALSTREAM(rawoutstream, "\n");
PRINTVALSTREAM(rawoutstream, " LAYT - is a string with the format:\n");
diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c
index 85abb8a..9236828 100644
--- a/tools/src/misc/h5debug.c
+++ b/tools/src/misc/h5debug.c
@@ -67,7 +67,6 @@
* Return: Non-NULL on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2008
*
*-------------------------------------------------------------------------
@@ -149,7 +148,6 @@ get_H5B2_class(const uint8_t *sig)
* Return: Non-NULL on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2008
*
*-------------------------------------------------------------------------
@@ -191,7 +189,6 @@ get_H5EA_class(const uint8_t *sig)
* Return: Non-NULL on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2008
*
*-------------------------------------------------------------------------