[Svnmerge] Command line options order

Blair Zajac blair at orcaware.com
Thu Nov 3 18:07:01 PST 2005


Giovanni Bajo wrote:
> Blair Zajac <blair at orcaware.com> wrote:
> 
> 
>>$ svnmerge -s -v -r 92481 merge
>>svnmerge: option -r not recognized
>>Type 'svnmerge help' for usage
>>
>>I finally figured out that I had to use
>>
>>$ svnmerge -s -v merge -r 92481
>>
>>I think one of the large issues that Subversion learned from CVS was
>>that positional command line options are a pain to use and that svn
>>takes special
>>care to not care where in the command line a particular command line
>>option appears.
>>
>>Can we get this changed?
> 
> 
> Options which are specific of a single command must currently appear after the
> command. Do you expect "svnmerge --diff avail" to work? It'd look rather
> strange to me.

Well, sometimes when you type, you don't pay attention too much to the detail.

> This said, "-r" is used by all commands, at the moment. I hadn't put it among
> global options because it's not global per-se: I can foresee some new command
> which does not accept --revision, while it's harder to foresee one that does
> not want "--verbose", "--dry-run", "--show-changes" (which are, in fact, global
> options).
> 
> So two solutions:
> 
> 1) Tweak OptionParser._fancy_getopt code to accept command-specific option
> before the command itself is seen on the command line (and I accept suggestion
> on how to parse the command line then).

How about making all the options parsed by the global option parsing code and 
have each subcommand throw an error if there's an option it doesn't use.  Kinda 
the negative of what is currently being done.

> 2) Make --revision a global command and revisit the issue when we add a command
> which does not use --revision.

Well, that's your call, as you're writing the code :)  If I get around to 
writing code, then I would do something like I suggested, but I don't have the 
cycles to code it up.

Regards,
Blair



More information about the Svnmerge mailing list