diff options
Diffstat (limited to 'utils/parseargs.cc')
-rw-r--r-- | utils/parseargs.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/utils/parseargs.cc b/utils/parseargs.cc index c5f3007e..ef971a5c 100644 --- a/utils/parseargs.cc +++ b/utils/parseargs.cc @@ -30,6 +30,7 @@ #include "parseargs.h" #include "goo/gstrtod.h" +#include "goo/GooString.h" static const ArgDesc *findArg(const ArgDesc *args, char *arg); static GBool grabArg(const ArgDesc *arg, int i, int *argc, char *argv[]); @@ -87,6 +88,7 @@ void printUsage(char *program, char *otherArgs, const ArgDesc *args) { break; case argString: case argStringDummy: + case argGooString: typ = " <string>"; break; case argFlag: @@ -152,6 +154,16 @@ static GBool grabArg(const ArgDesc *arg, int i, int *argc, char *argv[]) { n = 1; } break; + case argGooString: + if (i + 1 < *argc) { + ((GooString*)arg->val)->Set(argv[i+1], arg->size - 1); + ((GooString*)arg->val)->append('\0'); + n = 2; + } else { + ok = gFalse; + n = 1; + } + break; default: fprintf(stderr, "Internal error in arg table\n"); n = 1; |