Index: subversion/svndumpfilter/main.c
===================================================================
--- subversion/svndumpfilter/main.c	(revision 8959)
+++ subversion/svndumpfilter/main.c	(working copy)
@@ -674,7 +674,8 @@
     svndumpfilter__drop_empty_revs = SVN_OPT_FIRST_LONGOPT_ID,
     svndumpfilter__renumber_revs,
     svndumpfilter__preserve_revprops,
-    svndumpfilter__quiet
+    svndumpfilter__quiet,
+    svndumpfilter__version
   };
 
 /* Option codes and descriptions.
@@ -692,6 +693,8 @@
     {NULL,            '?', 0,
      "show help on a subcommand"},
 
+    {"version",            svndumpfilter__version, 0,
+     "show version information" },
     {"quiet",              svndumpfilter__quiet, 0,
      "Do not display filtering statistics." },
     {"drop-empty-revs",    svndumpfilter__drop_empty_revs, 0,
@@ -724,7 +727,7 @@
     {"help", subcommand_help, {"?", "h"},
      "Describe the usage of this program or its subcommands.\n"
      "usage: svndumpfilter help [SUBCOMMAND...]\n",
-     {0} },
+     {svndumpfilter__version} },
 
     { NULL, NULL, {0}, NULL, {0} }
   };
@@ -736,6 +739,7 @@
   svn_opt_revision_t start_revision;     /* -r X[:Y] is         */
   svn_opt_revision_t end_revision;       /* not implemented.    */
   svn_boolean_t quiet;                   /* --quiet             */
+  svn_boolean_t version;                 /* --version           */
   svn_boolean_t drop_empty_revs;         /* --drop-empty-revs   */
   svn_boolean_t help;                    /* --help or -?        */
   svn_boolean_t renumber_revs;           /* --renumber-revs     */
@@ -782,6 +786,7 @@
 static svn_error_t *
 subcommand_help (apr_getopt_t *os, void *baton, apr_pool_t *pool)
 {
+  struct svndumpfilter_opt_state *opt_state = baton;
   const char *header =
     "general usage: svndumpfilter SUBCOMMAND [ARGS & OPTIONS ...]\n"
     "Type \"svndumpfilter help <subcommand>\" for help on a "
@@ -789,7 +794,9 @@
     "\n"
     "Available subcommands:\n";
 
-  SVN_ERR (svn_opt_print_help (os, "svndumpfilter", FALSE, FALSE, NULL,
+  SVN_ERR (svn_opt_print_help (os, "svndumpfilter",
+                               opt_state ? opt_state->version : FALSE,
+                               FALSE, NULL,
                                header, cmd_table, options_table, NULL,
                                pool));
 
@@ -960,6 +967,9 @@
         case '?':
           opt_state.help = TRUE;
           break;
+        case svndumpfilter__version:
+          opt_state.version = TRUE;
+          opt_state.help = TRUE;
         case svndumpfilter__quiet:
           opt_state.quiet = TRUE;
           break;
Index: subversion/svnserve/main.c
===================================================================
--- subversion/svnserve/main.c	(revision 8959)
+++ subversion/svnserve/main.c	(working copy)
@@ -92,6 +92,7 @@
 #define SVNSERVE_OPT_LISTEN_HOST 257
 #define SVNSERVE_OPT_FOREGROUND  258
 #define SVNSERVE_OPT_TUNNEL_USER 259
+#define SVNSERVE_OPT_VERSION     260
 
 static const apr_getopt_option_t svnserve__options[] =
   {
@@ -103,6 +104,8 @@
     {"foreground",        SVNSERVE_OPT_FOREGROUND, 0,
      "run in foreground (useful for debugging)"},
     {"help",             'h', 0, "display this help"},
+    {"version",           SVNSERVE_OPT_VERSION, 0,
+     "show version information"},
     {"inetd",            'i', 0, "inetd mode"},
     {"root",             'r', 1, "root of directory to serve"},
     {"read-only",        'R', 0, "deprecated; use repository config file"},
@@ -143,6 +146,13 @@
   exit(1);
 }
 
+static svn_error_t * version(apr_getopt_t *os, apr_pool_t *pool)
+{
+  return svn_opt_print_help(os, "svnserve", TRUE, FALSE, NULL, NULL,
+                            NULL, NULL, NULL, pool);
+}
+  
+
 #if APR_HAS_FORK
 static void sigchld_handler(int signo)
 {
@@ -238,6 +248,11 @@
           help(pool);
           break;
 
+        case SVNSERVE_OPT_VERSION:
+          SVN_INT_ERR(version(os, pool));
+          exit(0);
+          break;
+          
         case 'd':
           run_mode = run_mode_daemon;
           break;
Index: subversion/svnversion/main.c
===================================================================
--- subversion/svnversion/main.c	(revision 8959)
+++ subversion/svnversion/main.c	(working copy)
@@ -19,8 +19,10 @@
 #include "svn_client.h"
 #include "svn_utf.h"
 #include "svn_path.h"
+#include "svn_opt.h"
 #include <apr_tables.h>
 
+#define SVNVERSION_OPT_VERSION SVN_OPT_FIRST_LONGOPT_ID
 
 struct status_baton
 {
@@ -107,9 +109,14 @@
     return SVN_NO_ERROR;
 }
 
+static svn_error_t * version(apr_getopt_t *os, apr_pool_t *pool)
+{
+  return svn_opt_print_help(os, "svnversion", TRUE, FALSE, NULL, NULL,
+                            NULL, NULL, NULL, pool);
+}
 
 static void
-usage(const apr_getopt_option_t *options)
+usage(const apr_getopt_option_t *options, apr_pool_t *pool)
 {
   fprintf(stderr, 
           "usage: svnversion [options] wc_path [trail_url]\n\n"
@@ -135,11 +142,12 @@
           "  If invoked on a directory that is not a working copy, an\n"
           "  exported directory say, the program will output \"exported\".\n"
           "\n"
-          "options:\n");
+          "Valid options:\n");
   while (options->description)
     {
-      fprintf(stderr, "  -%c  %s\n",
-              options->optch, options->description);
+      const char *optstr;
+      svn_opt_format_option(&optstr, options, TRUE, pool);
+      fprintf(stderr, "  %s\n", optstr);
       ++options;
     }
 }
@@ -169,6 +177,7 @@
     {
       {"no-newline", 'n', 0, "do not output the trailing newline"},
       {"committed",  'c', 0, "last changed rather than current revisions"},
+      {"version", SVNVERSION_OPT_VERSION, 0, "show version information"},
       {0,             0,  0,  0}
     };
 
@@ -208,7 +217,7 @@
         break;
       if (status != APR_SUCCESS)
         {
-          usage(options);
+          usage(options, pool);
           return EXIT_FAILURE;
         }
       switch (opt)
@@ -219,15 +228,19 @@
         case 'c':
           sb.committed = TRUE;
           break;
+        case SVNVERSION_OPT_VERSION:
+          SVN_INT_ERR(version(os, pool));
+          exit(0);
+          break;
         default:
-          usage(options);
+          usage(options, pool);
           return EXIT_FAILURE;
         }
     }
 
   if (os->ind >= argc || os->ind < argc - 2)
     {
-      usage(options);
+      usage(options, pool);
       return EXIT_FAILURE;
     }
 


