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

Re: svn commit: rev 1329 - trunk/subversion/svnadmin trunk/subversion/tests/clients/cmdline

From: Blair Zajac <blair_at_orcaware.com>
Date: 2002-02-20 08:33:01 CET

cmpilato@collab.net wrote:
> > > - " lstxns REPOS_PATH\n"
> > > - " Print all txns and their trees.\n"
> > > + " lstxns REPOS_PATH [long]\n"
> > > + " Print all txn names and, if \"long\" is specified, their\n"
> > > + " metadata and trees.\n"
> >
> > Shouldn't we have that as a --long option instead? It's odd to have a
> > command modifier after the target of the command.
>
> Nah. Svnadmin currently has no actual option parsing. I'd hate to
> add that code for this one little case.

I don't like going down this road though, as its not clean and may lead to
futher command line option oddities.

Here's a small hack for this. It's not a full blown command line parser,
but we can add later.

Best,
Blair

-- 
Blair Zajac <blair@orcaware.com>
Web and OS performance plots - http://www.orcaware.com/orca/
Index: ./subversion/svnadmin/main.c
===================================================================
--- ./subversion/svnadmin/main.c
+++ ./subversion/svnadmin/main.c	Tue Feb 19 23:19:40 2002
@@ -137,8 +137,8 @@
      "      If just LOWER_REV is given, that revision tree is printed.\n"
      "      If two revisions are given, that range is printed, inclusive.\n"
      "\n"
-     "   lstxns    REPOS_PATH [long]\n"
-     "      Print all txn names and, if \"long\" is specified, their\n"
+     "   lstxns    [--long] REPOS_PATH\n"
+     "      Print all txn names and, if \"--long\" is specified, their\n"
      "      metadata and trees.\n"
      "\n"
 #if 0 
@@ -303,15 +303,25 @@
         char *txn_name;
         svn_boolean_t show_extra = FALSE;
 
-        if (argc >= 4) 
+        /* Check for the --long command line option. */
+        if (strcmp(argv[2], "--long") == 0)
           {
-            if (strcmp (argv[3], "long"))
+            if (argc != 4)
               {
                 usage (argv[0], 1);
                 return EXIT_FAILURE;
               }
+
+            /* If --long is being used, path currently points to it,
+               so move path to the next string for the repository. */
+            path = argv[3];
             show_extra = TRUE;
           }
+        else if (argc != 3)
+          {
+            usage (argv[0], 1);
+            return EXIT_FAILURE;
+          }
 
         INT_ERR (svn_repos_open (&repos, path, pool));
         fs = svn_repos_fs (repos);
Index: ./subversion/tests/clients/cmdline/svnadmin_tests.py
===================================================================
--- ./subversion/tests/clients/cmdline/svnadmin_tests.py
+++ ./subversion/tests/clients/cmdline/svnadmin_tests.py	Tue Feb 19 23:29:20 2002
@@ -78,8 +78,8 @@
     rm = re.compile("^Revision\s+(.+)")
   else:
     output_lines, errput_lines = svntest.main.run_svnadmin("lstxns",
-                                                           repo_dir,
-                                                           "long")
+                                                           "--long",
+                                                           repo_dir)
     rm = re.compile("^Txn\s+(.+):")
 
   for line in output_lines:
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:09 2006

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.