[Svnmerge] Command line options order

Giovanni Bajo rasky at develer.com
Thu Nov 3 17:54:52 PST 2005


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.

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).
2) Make --revision a global command and revisit the issue when we add a command
which does not use --revision.

Comments?

Giovanni Bajo




More information about the Svnmerge mailing list