July 19, 2020 [Issue 21057] New: getopt, function setter for a long option receive the key, not the value | ||||
|---|---|---|---|---|
| ||||
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@puremagic.com Reporter: b2.temp@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. -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply