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

Re: [Patch] subcommand-specific option descriptors

From: Christian Stork <cstork_at_ics.uci.edu>
Date: 2006-02-17 07:42:08 CET

On Wed, Feb 15, 2006 at 09:11:26PM +0000, Julian Foad wrote:
> Christian Stork wrote:

> >Note that this patch is duplicating a little bit of information in the
> >new entries, which might not be a problem since this information
> >(option name and has_arg flag) should be very static.

> >@@ -407,7 +425,11 @@
> > " Use --force to steal the lock from another user or working
> > copy.\n"),
> > { svn_cl__targets_opt, 'm', 'F', svn_cl__force_log_opt,
> > svn_cl__encoding_opt, SVN_CL__AUTH_OPTIONS, svn_cl__config_dir_opt,
> >- svn_cl__force_opt } },
> >+ svn_cl__force_opt},
> >+ {{"file", 'F', 1, N_("read lock message from file ARG")},
> >+ {"message", 'm', 1, N_("specify lock message ARG")},
> >+ {0, 0, 0, 0}} },

> Little though it is, I think this is too much duplication of information,
> and would prefer a design that avoids it, perhaps just using the
> single-letter option name to identify the message.

Ok, here's a different version of the patch using your approach. The
downside is that it needs a bit more boilerplate.

[[[

Add subcommand-specific option descriptors in a new field in
svn_cl__cmd_table entries and use them for more sensible help
messages.
To illustrate, entries for -m and -F are added.

* trunk/subversion/include/svn_opt.h (svn_opt_option_desc_t):
  Add opt_desc_table field for subcommand-specific option description array.
  (svn_opt_subcommand_desc_t, svn_opt_get_opt_desc_from_code): New.

* trunk/subversion/libsvn_subr/opt.c (print_command_info,
  svn_opt_get_opt_desc_from_code): Print subcommand-specific option
  descriptions.

* trunk/subversion/clients/cmdline/main.c (svn_cl__cmd_table): Fill
  subcommand-specific options_table entries. For now, I only considered
  the -m and -F options.

]]]

I know that changing the public type svn_opt_subcommand_desc_t needs a
new name, etc. Let's discuss interface revving if the design of this
patch is accepted.

-- 
Chris Stork   <>  Support eff.org!  <>   http://www.ics.uci.edu/~cstork/
OpenPGP fingerprint:  B08B 602C C806 C492 D069  021E 41F3 8C8D 50F9 CA2F


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Fri Feb 17 07:42:29 2006

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.