You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2015/04/08 15:03:49 UTC

svn commit: r1672085 - /subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c

Author: julianfoad
Date: Wed Apr  8 13:03:49 2015
New Revision: 1672085

URL: http://svn.apache.org/r1672085
Log:
On the 'move-tracking-2' branch: Make 'svnmover --version -q' work.

* subversion/svnmover/svnmover.c
  (display_version): Take a 'quiet' flag. Don't crash if there are further
    command line arguments.
  (sub_main): Parse all option flags before showing the version, and pass
    the 'quiet' flag to 'display_version'.

Modified:
    subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c

Modified: subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c?rev=1672085&r1=1672084&r2=1672085&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c (original)
+++ subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c Wed Apr  8 13:03:49 2015
@@ -1909,7 +1909,7 @@ insufficient(int i, apr_pool_t *pool)
 }
 
 static svn_error_t *
-display_version(apr_getopt_t *os, apr_pool_t *pool)
+display_version(apr_getopt_t *os, svn_boolean_t _quiet, apr_pool_t *pool)
 {
   const char *ra_desc_start
     = "The following repository access (RA) modules are available:\n\n";
@@ -1918,7 +1918,7 @@ display_version(apr_getopt_t *os, apr_po
   version_footer = svn_stringbuf_create(ra_desc_start, pool);
   SVN_ERR(svn_ra_print_modules(version_footer, pool));
 
-  SVN_ERR(svn_opt_print_help4(os, "svnmover", TRUE, FALSE, FALSE,
+  SVN_ERR(svn_opt_print_help4(NULL, "svnmover", TRUE, _quiet, FALSE,
                               version_footer->data,
                               NULL, NULL, NULL, NULL, NULL, pool));
 
@@ -2194,6 +2194,7 @@ sub_main(int *exit_code, int argc, const
   const char *anchor_url = NULL, *extra_args_file = NULL;
   const char *config_dir = NULL;
   apr_array_header_t *config_options;
+  svn_boolean_t show_version = FALSE;
   svn_boolean_t non_interactive = FALSE;
   svn_boolean_t force_interactive = FALSE;
   svn_boolean_t interactive_actions;
@@ -2302,8 +2303,8 @@ sub_main(int *exit_code, int argc, const
           no_auth_cache = TRUE;
           break;
         case version_opt:
-          SVN_ERR(display_version(opts, pool));
-          return SVN_NO_ERROR;
+          show_version = TRUE;
+          break;
         case 'h':
         case '?':
           usage(stdout, pool);
@@ -2311,6 +2312,12 @@ sub_main(int *exit_code, int argc, const
         }
     }
 
+  if (show_version)
+    {
+      SVN_ERR(display_version(opts, quiet, pool));
+      return SVN_NO_ERROR;
+    }
+
   if (non_interactive && force_interactive)
     {
       return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,