Options order....

Marcin Kasperski Marcin.Kasperski at softax.com.pl
Sun May 6 12:37:17 CDT 2007


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 
one to freely mix options and params. For example subversion and cvs 
work so, both
svn ci . -m 'blah'
and
cvs ci . -m 'bleh'
work.
> You parse the parameters identified by the '-' prefix (with optional 
> extra arg, if defined), and finish this once you find the first 
> argument that has no '-'.

Alternative (and, I would dare to say, more popular) algorithm is to go 
over all parameters, handling everything starting from '-' as options 
and leaving the rest (there is also '--' case, but let's leave it here).


More information about the Mercurial mailing list