Author: philip
Date: Fri Jul  8 18:18:12 2011
New Revision: 1144413

URL: http://svn.apache.org/viewvc?rev=1144413&view=rev
Log:
Add --version to svnmucc, tweak licence text format to look like the
other instances.

* tools/client-side/svnmucc/svnmucc.c
  (usage): Add --version.
  (display_version): New.
  (main): Add --version, rename config_no_auth_cache_opt to no_auth_cache_opt.

Modified:
    subversion/trunk/tools/client-side/svnmucc/svnmucc.c

Modified: subversion/trunk/tools/client-side/svnmucc/svnmucc.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/tools/client-side/svnmucc/svnmucc.c?rev=1144413&r1=1144412&r2=1144413&view=diff
==============================================================================
--- subversion/trunk/tools/client-side/svnmucc/svnmucc.c (original)
+++ subversion/trunk/tools/client-side/svnmucc/svnmucc.c Fri Jul  8 18:18:12 
2011
@@ -1,21 +1,24 @@
 /*
+ * svnmucc.c: Subversion Multiple URL Client
  *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
+ * ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- *   http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  *
  */
 
@@ -23,10 +26,6 @@
 
     Combine a list of mv, cp and rm commands on URLs into a single commit.
 
-    Copyright 2005 Philip Martin <[email protected]>
-
-    Licenced under the same terms as Subversion.
-
     How it works: the command line arguments are parsed into an array of
     action structures.  The action structures are interpreted to build a
     tree of operation structures.  The tree of operation structures is
@@ -783,7 +782,8 @@ usage(apr_pool_t *pool, int exit_val)
     "                        use \"-\" to read from standard input)\n"
     "  --config-dir ARG      use ARG to override the config directory\n"
     "  --config-option ARG   use ARG so override a configuration option\n"
-    "  --no-auth-cache       do not cache authentication tokens\n";
+    "  --no-auth-cache       do not cache authentication tokens\n"
+    "  --version             print version information\n";
   svn_error_clear(svn_cmdline_fputs(msg, stream, pool));
   apr_pool_destroy(pool);
   exit(exit_val);
@@ -797,6 +797,22 @@ insufficient(apr_pool_t *pool)
                pool);
 }
 
+static svn_error_t *
+display_version(apr_getopt_t *os, apr_pool_t *pool)
+{
+  const char *ra_desc_start
+    = "The following repository access (RA) modules are available:\n\n";
+  svn_stringbuf_t *version_footer;
+
+  version_footer = svn_stringbuf_create(ra_desc_start, pool);
+  SVN_ERR(svn_ra_print_modules(version_footer, pool));
+
+  SVN_ERR(svn_opt_print_help3(os, "svnmucc", TRUE, FALSE, version_footer->data,
+                              NULL, NULL, NULL, NULL, NULL, pool));
+
+  return SVN_NO_ERROR;
+}
+
 int
 main(int argc, const char **argv)
 {
@@ -809,7 +825,8 @@ main(int argc, const char **argv)
   enum {
     config_dir_opt = SVN_OPT_FIRST_LONGOPT_ID,
     config_inline_opt,
-    config_no_auth_cache_opt,
+    no_auth_cache_opt,
+    version_opt,
     with_revprop_opt
   };
   const apr_getopt_option_t options[] = {
@@ -825,7 +842,8 @@ main(int argc, const char **argv)
     {"non-interactive", 'n', 0, ""},
     {"config-dir", config_dir_opt, 1, ""},
     {"config-option",  config_inline_opt, 1, ""},
-    {"no-auth-cache",  config_no_auth_cache_opt, 0, ""},
+    {"no-auth-cache",  no_auth_cache_opt, 0, ""},
+    {"version", version_opt, 0, ""},
     {NULL, 0, 0, NULL}
   };
   const char *message = NULL;
@@ -930,9 +948,13 @@ main(int argc, const char **argv)
           if (err)
             handle_error(err, pool);
           break;
-        case config_no_auth_cache_opt:
+        case no_auth_cache_opt:
           no_auth_cache = TRUE;
           break;
+        case version_opt:
+          SVN_INT_ERR(display_version(getopt, pool));
+          exit(EXIT_SUCCESS);
+          break;
         case 'h':
           usage(pool, EXIT_SUCCESS);
           break;


Reply via email to