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

Re: svn commit: r29544 - in trunk/subversion: libsvn_subr svn

From: David Glasser <glasser_at_davidglasser.net>
Date: Tue, 26 Feb 2008 12:39:14 -0800

On Fri, Feb 22, 2008 at 12:52 PM, <cmpilato_at_tigris.org> wrote:
> Author: cmpilato
> Date: Fri Feb 22 12:52:02 2008
> New Revision: 29544
>
> Log:
> Poor man's long-option aliasing, introducing --cl as an alias for
> --changelist.
>
> * subversion/svn/main.c
> (svn_cl__options): Add --cl as a long-opt alias, and note this alias
> in --changelist's description.
>
> * subversion/libsvn_subr/opt.c
> (print_command_info, print_command_info2): Don't print options with
> NULL descriptions.

Hmm, this man is a little too poor for me. If I'm looking for what an
option does, then I'm looking in the left column with everything else,
and am unlikely to notice the one option name that's in the right
column.

Possible solutions, from most to least hacky:

- Remove some of the spaces from the second line, so it looks like
  --changelist ARG : operate only on members of changelist ARG
    [alias: --cl ARG]

- Make an opt_changelist_abbr like
{"cl", opt_changelist_abbr, 1, "same as --changelist ARG"}
and
#define CHANGELIST_OPTS opt_changelist, _optchangelist_abbr
and
s/opt_changelist/CHANGELIST_OPTS/ inside the subcommand table
and
make main treat the values as the same.

- Throw out apr_getopt_t and rewrite everything to support long option
aliases (ha).

- Add long option aliases to APR.

Do any of these sounds good, or is the current UI just fine?

--dave

> Modified:
> trunk/subversion/libsvn_subr/opt.c
> trunk/subversion/svn/main.c
>
> Modified: trunk/subversion/libsvn_subr/opt.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_subr/opt.c?pathrev=29544&r1=29543&r2=29544
> ==============================================================================
> --- trunk/subversion/libsvn_subr/opt.c (original)
> +++ trunk/subversion/libsvn_subr/opt.c Fri Feb 22 12:52:02 2008
> @@ -242,7 +242,7 @@
> cmd, pool);
>
> /* print the option's docstring */
> - if (option)
> + if (option && option->description)
> {
> const char *optstr;
> svn_opt_format_option(&optstr, option, TRUE, pool);
> @@ -268,7 +268,7 @@
> cmd, pool);
>
> /* print the option's docstring */
> - if (option)
> + if (option && option->description)
> {
> const char *optstr;
> svn_opt_format_option(&optstr, option, TRUE, pool);
> @@ -345,7 +345,7 @@
> options_table);
>
> /* print the option's docstring */
> - if (option)
> + if (option && option->description)
> {
> const char *optstr;
> svn_opt_format_option(&optstr, option, TRUE, pool);
>
> Modified: trunk/subversion/svn/main.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/svn/main.c?pathrev=29544&r1=29543&r2=29544
> ==============================================================================
> --- trunk/subversion/svn/main.c (original)
> +++ trunk/subversion/svn/main.c Fri Feb 22 12:52:02 2008
> @@ -239,7 +239,9 @@
> {"summarize", opt_summarize, 0, N_("show a summary of the results")},
> {"remove", opt_remove, 0, N_("remove changelist association")},
> {"changelist", opt_changelist, 1,
> - N_("operate only on members of changelist ARG")},
> + N_("operate only on members of changelist ARG\n"
> + " "
> + "[aliases: --cl]")},
> {"keep-changelists", opt_keep_changelists, 0,
> N_("don't delete changelists after commit")},
> {"keep-local", opt_keep_local, 0, N_("keep path in working copy")},
> @@ -272,6 +274,15 @@
> N_("query a particular merge source URL")},
> {"reintegrate", opt_reintegrate, 0,
> N_("lump-merge all of source URL's unmerged changes")},
> +
> + /* Long-opt Aliases
> + *
> + * These have NULL desriptions, but an option code that matches some
> + * other option (whose description should probably mention its aliases).
> + */
> +
> + {"cl", opt_changelist, 1, NULL},
> +
> {0, 0, 0, 0},
> };
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe_at_subversion.tigris.org
> For additional commands, e-mail: svn-help_at_subversion.tigris.org
>
>

-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-02-26 21:39:28 CET

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