phobos
                                
                                 phobos copied to clipboard
                                
                                    phobos copied to clipboard
                            
                            
                            
                        std.getopt: No support for empty string values with `--key=value` syntax
void parseAndPrint(string[] args) {
    import std.getopt, std.stdio;
    string arg1, arg2;
    auto r = getopt(args, "arg1", "bla", &arg1, "arg2", "bla", &arg2);
    writeln("arg1: ", arg1);
    writeln("arg2: ", arg2);
}    
void main() {
    parseAndPrint(["prog", "--arg1=p1", "--arg2=p2"]);
    parseAndPrint(["prog", "--arg1", "p1", "--arg2", "p2"]);
    parseAndPrint(["prog", "--arg1=", "--arg2=p2"]);
}
Output:
arg1: p1
arg2: p2
arg1: p1
arg2: p2
arg1: --arg2=p2   # expected: empty string
arg2:             # expected: p2
So --arg1= consumes the next arg as value instead of parsing an empty value. I don't think I've seen this behavior anywhere else, so this was pretty surprising to me. A quirky workaround is using ["--arg1", "", "--arg2=p2"].