std.getopt suggestion

Marco Leise Marco.Leise at gmx.de
Tue Oct 4 21:29:05 PDT 2011


Am 05.10.2011, 03:28 Uhr, schrieb Jonathan M Davis <jmdavisProg at gmx.com>:

> 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

In Python they use this syntax exclusively in the command-line parser.  
Disallowing Windows-style or other non-GNU standard options. That's one  
way to get rid of an "options" parameter I guess.


More information about the Digitalmars-d mailing list