|
From: <kin...@us...> - 2025-09-30 15:46:51
|
Revision: 7540
http://sourceforge.net/p/teem/code/7540
Author: kindlmann
Date: 2025-09-30 15:46:48 +0000 (Tue, 30 Sep 2025)
Log Message:
-----------
disallowing - inside the long flag was a mistake; the issue is that the long flag shouldnt start with -
Modified Paths:
--------------
teem/trunk/src/hest/methodsHest.c
Modified: teem/trunk/src/hest/methodsHest.c
===================================================================
--- teem/trunk/src/hest/methodsHest.c 2025-09-30 15:24:21 UTC (rev 7539)
+++ teem/trunk/src/hest/methodsHest.c 2025-09-30 15:46:48 UTC (rev 7540)
@@ -742,8 +742,8 @@
biffAddf(HEST, "%s%sstrlen(opt[%u].flag) %u is too big", _ME_, opi, fslen);
return 1;
}
- if (strchr(flag, '-')) {
- biffAddf(HEST, "%s%sopt[%u].flag \"%s\" contains '-', which will confuse things",
+ if ('-' == flag[0]) {
+ biffAddf(HEST, "%s%sopt[%u].flag \"%s\" starts with '-', which is confusing",
_ME_, opi, flag);
return 1;
}
@@ -772,6 +772,20 @@
_ME_, tbuff, sep + 1, opi);
return (free(tbuff), 1);
}
+ if (strchr(sep + 1, MULTI_FLAG_SEP)) {
+ biffAddf(HEST,
+ "%s%sopt[%u] flag string \"%s\" has more than one instance of "
+ "short/long separation character '%c'",
+ _ME_, opi, flag, MULTI_FLAG_SEP);
+ return (free(tbuff), 1);
+ }
+ if ('-' == (sep + 1)[0]) {
+ biffAddf(HEST,
+ "%s%slong flag \"%s\" (part of \"%s\") of opt[%u] starts with '-', "
+ "which is confusing",
+ _ME_, sep + 1, flag, opi);
+ return 1;
+ }
if (hparm->respectDashDashHelp && !strcmp("help", sep + 1)) {
biffAddf(HEST,
"%s%slong \"--%s\" flag of opt[%u] is same as \"--help\" "
@@ -779,13 +793,6 @@
_ME_, sep + 1, opi);
return (free(tbuff), 1);
}
- if (strchr(sep + 1, MULTI_FLAG_SEP)) {
- biffAddf(HEST,
- "%s%sopt[%u] flag string \"%s\" has more than one instance of "
- "short/long separation character '%c'",
- _ME_, opi, flag, MULTI_FLAG_SEP);
- return (free(tbuff), 1);
- }
} else {
if (!strlen(hopt[opi].flag)) {
biffAddf(HEST, "%s%sopt[%u].flag is zero length", _ME_, opi);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|