getopt & single-letter options with parameters
Adrian Matoga
epi at atari8.info
Sat Aug 7 15:55:38 PDT 2010
Hi,
Is it by design that single-letter option needs to be glued to its
argument, like "-ofilename", or is it a bug in implementation?
Source:
import std.stdio;
import std.getopt;
void main(string[] args)
{
string outputFile;
getopt(args,
config.passThrough,
"o|output-filename", &outputFile);
writeln(args);
writeln("'" ~ outputFile ~ "'");
}
Results:
>test.exe -o somename
test.exe somename
''
>test.exe -osomename
test.exe
'somename'
Regards,
Adrian Matoga
More information about the Digitalmars-d
mailing list