std.getopt suggestion

Jonathan M Davis jmdavisProg at gmx.com
Tue Oct 4 18:28:51 PDT 2011


On Wednesday, October 05, 2011 02:51:47 Andrej Mitrovic wrote:
> Yeah I've never seen --abc used as -a -b -c before, it looks quite
> strange to me. Is this common in unixland?

In unix land, the normal situation is that -- denotes a flag with one or more 
characters in it, whereas - denotes a flag with exactly one character in it, 
and flags with one character can usually be concatenated. So, --abc denotes the 
flag abc, and -abc denotes the flags a, b, and c. I don't believe that I have 
ever seen a program which took single character flags with --, and programs 
which take multi-character flags with - are rare.

- Jonathan M Davis


More information about the Digitalmars-d mailing list