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