[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Check min and max num targets in client args patch.

From: B. W. Fitzpatrick <fitz_at_red-bean.com>
Date: 2001-03-07 07:34:07 CET

> I noticed some problems with the way the command line
> client was checking the user's input before passing
> commands to the actual function. For example, a
> call to `svn delete` should notice that at least
> 1 argument is required and print the help text
> for the delete subcommand.

Well, we could always just have it print out the command specific help...

> The current code passed the args to the delete subcommand anyway and
> that printed the main usage text instead of the delete help
> text. The following patch fixes the problem by adding a min and max
> number of targets field to the command struct. Main then checks to
> see if the number of arguments the user passed satisfies the (0 to
> N) or (1 to N) requirement.

Is this really worth it? Looking through the commands that we need to
support, it seems like only a few have this requirement:

Where 'Number of file args' is blank, 0, 1, or more files can be
passed. This includes commands that take '.' as a default file arg.

COMMAND Number of file args
add 1 or more
branch 0?
convert ?
copy 2 or more?
delete 1, or more
import ?
log 0, 1, or more
merge ?
rename 2
repo ?

I would vote to leave the checking in the command, although I don't
feel all that strongly about it. Does anyone else have any feelings on

Received on Sat Oct 21 14:36:25 2006

This is an archived mail posted to the Subversion Dev mailing list.