|
From: <kin...@us...> - 2025-09-28 08:06:14
|
Revision: 7505
http://sourceforge.net/p/teem/code/7505
Author: kindlmann
Date: 2025-09-28 08:06:12 +0000 (Sun, 28 Sep 2025)
Log Message:
-----------
more testing
Modified Paths:
--------------
teem/trunk/src/hest/methodsHest.c
teem/trunk/src/hest/parsest.c
teem/trunk/src/hest/test/ex6.c
Modified: teem/trunk/src/hest/methodsHest.c
===================================================================
--- teem/trunk/src/hest/methodsHest.c 2025-09-28 07:53:28 UTC (rev 7504)
+++ teem/trunk/src/hest/methodsHest.c 2025-09-28 08:06:12 UTC (rev 7505)
@@ -121,7 +121,8 @@
int ret;
if (1 != slen) {
snprintf(hpp->err, AIR_STRLEN_HUGE + 1,
- "expected single char but got string length %u", AIR_UINT(slen));
+ "expected single char but got string \"%s\" length %u", str,
+ AIR_UINT(slen));
ret = 1;
} else {
char *out = (char *)_out;
Modified: teem/trunk/src/hest/parsest.c
===================================================================
--- teem/trunk/src/hest/parsest.c 2025-09-28 07:53:28 UTC (rev 7504)
+++ teem/trunk/src/hest/parsest.c 2025-09-28 08:06:12 UTC (rev 7505)
@@ -1347,7 +1347,7 @@
} // end case 4 {
case 2: // -------- one required parameter --------
if (_hestParseSingle[type](valueP, opt[opi].havec->harg[0]->str, hpp)) {
- biffAddf(HEST, "%s%sproblem parsing for %s[%u]", _ME_, ident, opi);
+ biffAddf(HEST, "%s%sproblem parsing for %s[%u]: %s", _ME_, ident, opi, hpp->err);
return 1;
}
opt[opi].alloc = hpp->alloc;
@@ -1610,7 +1610,7 @@
free(err); \
}
- // --0--0--0--0--0-- check on validity of the hestOpt array
+ // --1--1--1--1--1-- check on validity of the hestOpt array
if (_hestOPCheck(opt, HPARM)) {
DO_ERR("problem with given hestOpt array");
airMopError(mop);
@@ -1631,7 +1631,7 @@
printf("%s: parsing state allocated\n", __func__);
}
- // --1--1--1--1--1-- initialize input stack w/ given argc,argv, process it
+ // --2--2--2--2--2-- initialize input stack w/ given argc,argv, process it
if (histPushCommandLine(hist, argc, argv, HPARM)
|| histProcess(havec, &(opt->helpWanted), tharg, hist, HPARM)) {
DO_ERR("problem with initial processing of command-line");
@@ -1648,8 +1648,9 @@
return 0;
}
- // --2--2--2--2--2-- extract args associated with flagged and unflagged opt
+ // --3--3--3--3--3-- extract args associated with flagged options
if (havecExtractFlagged(opt, havec, HPARM)
+ // --4--4--4--4--4-- extract args associated with unflagged options
// this will detect extraneous args after unflagged opts are extracted
|| havecExtractUnflagged(opt, havec, HPARM)) {
DO_ERR("problem extracting args for options");
@@ -1657,7 +1658,7 @@
return 1;
}
- /* --3--3--3--3--3-- process defaults strings for opts that weren't user-supplied
+ /* --5--5--5--5--5-- process defaults strings for opts that weren't user-supplied
Like havecExtract{,Un}Flagged, this builds up opt->havec, but does not parse it */
if (optProcessDefaults(opt, tharg, hist, HPARM)) {
DO_ERR("problem with processing defaults");
@@ -1665,7 +1666,7 @@
return 1;
}
- // --4--4--4--4--4-- Finally, parse the args and set values
+ // --6--6--6--6--6-- Finally, parse the args and set values
if (optSetValues(opt, HPARM, mop)) {
DO_ERR("problem with setting values");
airMopError(mop);
Modified: teem/trunk/src/hest/test/ex6.c
===================================================================
--- teem/trunk/src/hest/test/ex6.c 2025-09-28 07:53:28 UTC (rev 7504)
+++ teem/trunk/src/hest/test/ex6.c 2025-09-28 08:06:12 UTC (rev 7505)
@@ -84,7 +84,7 @@
hparm->respectDashDashHelp = AIR_TRUE;
hparm->noArgsIsNoProblem = AIR_TRUE;
hparm->dieLessVerbose = AIR_TRUE;
- hparm->verbosity = 0;
+ hparm->verbosity = 1;
opt = NULL;
/* going past C89 to have declarations here */
@@ -147,10 +147,10 @@
"test of hestOptAdd_1_Double");
char c1;
hestOptAdd_1_Char(&opt, "c1", "char1", &c1, "x", "test of hestOptAdd_1_Char");
- /*
char *s1;
hestOptAdd_1_String(&opt, "s1", "string1", &s1, "\"bingo bob\"",
"test of hestOptAdd_1_String");
+ /*
int e1;
hestOptAdd_1_Enum(&opt, "e1", "enum1", &e1, "little", "test of hestOptAdd_1_Enum",
airEndian);
@@ -428,8 +428,8 @@
printf("fl1 = %g\n", fl1);
printf("db1 = %g\n", db1);
printf("c1 = |%c| (%d)\n", c1, c1);
+ printf("s1 = |%s|\n", s1);
/*
- printf("s1 = |%s|\n", s1);
printf("e1 = %d\n", e1);
printf("p1 = %g,%g\n", p1[0], p1[1]);
printf("q1 (@ %p) = %g(%s)\n", q1, q1->val, q1->str);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|