Options order....

Mark A. Flacy mflacy at verizon.net
Sun May 6 15:59:37 CDT 2007


On 2007.05.06 12:37, Marcin Kasperski wrote:
> Guido Ostkamp napisał(a):
> >>> You need to specify the options before the files.
> >> I already noticed it. The question is: *why*?
> >
> > probably because that's pretty much standard for most commands. 
> Well, hard to say what is 'standard', but most unix commands I use allow 

Most of your "unix" commands are probably using GNU getopts. 

However, the standard Python option parser allows you to act consistent with other unixes.

http://docs.python.org/lib/optparse-other-methods.html second bullet.

"This restores traditional Unix syntax, where option parsing stops with the first non-option argument."


Having had to *write* documentation explaining optional versus non-optional parameters, it's a lot easier to tell people what the command lines should look like when you reduce the amount of needless permutations of command line inputs.






More information about the Mercurial mailing list