From 29559e0716cdcdb62bd5e5b074c5cb9a32a17595 Mon Sep 17 00:00:00 2001 From: mm2 Date: Wed, 4 Nov 2020 20:58:35 +0100 Subject: updating to 2.12 Change resource compiler files for windows try to add --help to command line utilities --- utils/common/xgetopt.c | 9 ++++++--- utils/transicc/transicc.c | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) (limited to 'utils') diff --git a/utils/common/xgetopt.c b/utils/common/xgetopt.c index 7f3dc54..a3511a6 100644 --- a/utils/common/xgetopt.c +++ b/utils/common/xgetopt.c @@ -32,13 +32,16 @@ int xgetopt(int argc, char *argv[], char *optionS) SW = '/'; } + if (argc > xoptind) { + if (letP == NULL) { if ((letP = argv[xoptind]) == NULL || *(letP++) != SW) goto gopEOF; - if (*letP == SW) { - xoptind++; goto gopEOF; - } + + //if (*letP == SW) { + // xoptind++; goto gopEOF; + //} } if (0 == (ch = *(letP++))) { xoptind++; goto gopEOF; diff --git a/utils/transicc/transicc.c b/utils/transicc/transicc.c index 1dc67f8..4786687 100644 --- a/utils/transicc/transicc.c +++ b/utils/transicc/transicc.c @@ -145,10 +145,22 @@ void HandleSwitches(int argc, char *argv[]) int s; while ((s = xgetopt(argc, argv, - "bBC:c:d:D:eEgGI:i:L:l:m:M:nNO:o:p:P:QqSsT:t:V:v:WwxX!:")) != EOF) { + "bBC:c:d:D:eEgGI:i:L:l:m:M:nNO:o:p:P:QqSsT:t:V:v:WwxX!:-:")) != EOF) { switch (s){ + case '-': + if (strcmp(xoptarg, "help") == 0) + { + Help(); + exit(0); + } + else + { + FatalError("Unknown option - run without args to see valid ones.\n"); + } + break; + case '!': IncludePart = xoptarg; break; @@ -858,7 +870,7 @@ cmsFloat64Number GetIT8Val(const char* Name, cmsFloat64Number Max) // Read input values from CGATS file. static - void TakeCGATSValues(int nPatch, cmsFloat64Number Float[]) +void TakeCGATSValues(int nPatch, cmsFloat64Number Float[]) { // At first take the name if SAMPLE_ID is present -- cgit v1.2.1