nenum() does not return an enum value, but an index into the underlying
array, which means that the first element is 1 and not zero like the
code assumed. The help output was off-by-one, and could error out if
some environment variable was set that was affecting the help output.
Fixes #1438.
Change-Id: Iec2f05c9ced55868902069ce59bc4979a6879f86
return;
case etENUM:
options->addOption(
- StringOption(name).defaultEnumIndex(nenum(pa->u.c))
+ StringOption(name).defaultEnumIndex(nenum(pa->u.c) - 1)
.enumValueFromNullTerminatedArray(pa->u.c + 1)
.description(desc).hidden(bHidden));
return;