Comment #0 by witold.baryluk+d — 2020-05-11T04:03:07Z
import std.getop;
auto optparser = getopt(
args,
std.getopt.config.passThrough,
std.getopt.config.caseSensitive,
....,
"iterations_min", "A iterations minimum (default: " ~ to!string(iterations_min) ~ ")", &iterations_min,
"iterations_max", "A iterations maximum (default: " ~ to!string(iterations_max) ~ ")", &iterations_min,
);
Spot the error.
It should be detected by the getopt automatically and throw an exception without even checking the 'args'. I really doubt there is a valid use case to have duplicated pointers, and if there is (i.e. renaming flags and deprecating but supporting old one), it can be enabled using std.getopt.config flag.
Comment #1 by robert.schadek — 2024-12-01T16:36:46Z