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

Re: [PATCH] svnversion should output its help messages to stdout (Take 2)

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2005-02-23 15:27:27 CET

Kobayashi Noritada wrote:
> Hi,
>
> This is a patch to make the default error message for svnversion shorter
> and to add an option '--help', which display the long help message that
> is the current default error message.

Great.

> Index: subversion/svnversion/main.c
> ===================================================================
> --- subversion/svnversion/main.c (revision 13122)
> +++ subversion/svnversion/main.c (working copy)
> @@ -117,11 +117,20 @@
> }
>
> static void
> -usage(const apr_getopt_option_t *options, apr_pool_t *pool)
> +usage(apr_pool_t *pool)
> {
> + svn_error_clear (svn_cmdline_fprintf
> + (stderr, pool, _("Type 'svnversion --help' for usage.\n")));
> + exit(1);
> +}
> +
> +
> +static void
> +help(const apr_getopt_option_t *options, apr_pool_t *pool)
> +{
> svn_error_clear
> (svn_cmdline_fprintf
> - (stderr, pool,
> + (stdout, pool,
> _("usage: svnversion [OPTIONS] WC_PATH [TRAIL_URL]\n\n"
> " Produce a compact 'version number' for the working copy path\n"
> " WC_PATH. TRAIL_URL is the trailing portion of the URL used to\n"
> @@ -150,9 +159,11 @@
> {
> const char *optstr;
> svn_opt_format_option(&optstr, options, TRUE, pool);
> - svn_error_clear (svn_cmdline_fprintf(stderr, pool, " %s\n", optstr));
> + svn_error_clear (svn_cmdline_fprintf(stdout, pool, " %s\n", optstr));
> ++options;
> }
> + svn_error_clear (svn_cmdline_fprintf(stdout, pool, "\n"));
> + exit(1);

exit(0), since displaying the help is now by request and no longer an error.

+1 with that change.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Feb 23 15:28:44 2005

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.