std.getopt seems to fail when reversing the order of the options passed as args when config.stopOnFirstNonOption is enabled. string dir1; string dir2; string[] args = ["./app", "--dir1", "dir1","--dir2", "dir2"]; auto result = getopt(args, config.stopOnFirstNonOption, "dir1", "first dir", &dir1, "dir2", "second dir", &dir2); assert(dir1 == "dir1" && dir2 == "dir2"); args = ["./app", "--dir2", "dir2","--dir1", "dir1"]; // No problem without 'config.stopOnFirstNonOption' result = getopt(args, "dir1", "first dir", &dir1, "dir2", "second dir", &dir2); assert(dir1 == "dir1" && dir2 == "dir2"); args = ["./app", "--dir2", "dir2","--dir1", "dir1"]; // Throws: "Unrecognized option --dir1" result = getopt(args, config.stopOnFirstNonOption, "dir1", "first dir", &dir1, "dir2", "second dir", &dir2);
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10362 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB