summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5tools_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/h5tools_utils.c')
-rw-r--r--tools/lib/h5tools_utils.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c
index a221465..46b425b 100644
--- a/tools/lib/h5tools_utils.c
+++ b/tools/lib/h5tools_utils.c
@@ -120,7 +120,9 @@ warn_msg(const char *progname, const char *fmt, ...)
* Programmer: Bill Wendling
* Friday, 5. January 2001
*
- * Modifications:
+ * Modifications: Pedro Vicente
+ * October, 27 2008
+ * Wilcard "*" argument type
*
*-------------------------------------------------------------------------
*/
@@ -230,12 +232,33 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
}
sp = 1;
- } else {
+ }
+
+ /* wildcard argument */
+ else if (*cp == '*')
+ {
+ /* check the next argument */
+ opt_ind++;
+ /* we do have an extra argument, check if not last */
+ if ( argv[opt_ind][0] != '-' && (opt_ind+1) < argc )
+ {
+ opt_arg = argv[opt_ind++];
+ }
+ else
+ {
+ opt_arg = NULL;
+ }
+ }
+
+ else
+ {
/* set up to look at next char in token, next time */
if (argv[opt_ind][++sp] == '\0') {
/* no more in current token, so setup next token */
opt_ind++;
sp = 1;
+
+
}
opt_arg = NULL;