[Issue 21057] New: getopt, function setter for a long option receive the key, not the value
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Jul 19 15:48:09 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=21057
Issue ID: 21057
Summary: getopt, function setter for a long option receive the
key, not the value
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: b2.temp at gmx.com
Not sure if it is a major one, considering that nobody has reported it yet but
this the setter for a long option is called with the wrong part of the option,
e.g for "--key=value" the setter is called with "key":
---
void setValue(string value)
{
assert(value == value.stringof, value);
}
void main(string[] args)
{
args ~= "--key=value";
import std.getopt;
getopt(args, "key", &setValue);
}
---
unless i handle the fix by myself, open a PR in for the stable branch please.
--
More information about the Digitalmars-d-bugs
mailing list