[Issue 9583] New: std.getopt.getopt does not consume options terminator "--" from args list, as docs claim
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Feb 24 10:43:59 PST 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9583
Summary: std.getopt.getopt does not consume options terminator
"--" from args list, as docs claim
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: hsteoh at quickfur.ath.cx
--- Comment #0 from hsteoh at quickfur.ath.cx 2013-02-24 10:43:56 PST ---
Code:
import std.getopt;
import std.stdio;
void main(string[] args) {
int opt;
writeln(args);
getopt(args, "opt", &opt);
writeln(args);
}
Results:
$ ./test --opt=123 -- --a --b --c
["./test", "--opt=123", "--", "--a", "--b", "--c"]
["./test", "--", "--a", "--b", "--c"]
$
Contrary to what the docs claim, the options terminator "--" is not consumed by
getopt.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list