You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by kf...@collab.net on 2004/10/12 20:11:01 UTC

[PATCH] make 'svn help' tell how to discover version

Does anyone have any objections to this patch?  It makes 'svn help' do
this:

   $ svn help
   usage: svn <subcommand> [options] [args]
   Type 'svn help <subcommand>' for help on a specific subcommand.
   Type 'svn --version' to see the version number of this software.
   
   Most subcommands take file and/or directory arguments, recursing
   on the directories.  If no arguments are supplied to such a
   command, it recurses on the current directory (inclusive) by default.
   
   Available subcommands:
      [...]

Note the new third line ("Type 'svn --version' to see...").  But I
adjusted the paragraph after it to lose its short final line, so that
the total line count in help output is still the same.

Due to some local box horkage, I haven't built and tested this yet,
but I would do that before committing of course.  I'm mainly
interested in whether people think it's a good idea.

-Karl

[[[
Make 'svn help' output tell how to discover the version number.

* subversion/clients/cmdline/help-cmd.c
  (svn_cl__help_header): Add a line about running 'svn --version'.
    Tweak a wording later on, to save a line, so the total number of
    lines in the help output remains the same.  This involved
    reformatting the source so as to make the strings start in an
    earlier column, which in turn makes this change appear more
    drastic than it actually is. 
  (svn_cl__help_footer): No semantic change, just make the same
    start-column adjustment as above, for consistency.

* subversion/tests/clients/cmdline/getopt_tests_data/svn--help_stdout,
  subversion/tests/clients/cmdline/getopt_tests_data/svn_help_stdout:
    Adjust accordingly.
]]]

Index: subversion/clients/cmdline/help-cmd.c
===================================================================
--- subversion/clients/cmdline/help-cmd.c       (revision 11336)
+++ subversion/clients/cmdline/help-cmd.c       (working copy)
@@ -32,20 +32,20 @@
 #include "svn_private_config.h"
 
 const char svn_cl__help_header[] =
-    N_("usage: svn <subcommand> [options] [args]\n"
-       "Type 'svn help <subcommand>' for help on a specific subcommand.\n"
-       "\n"
-       "Most subcommands take file and/or directory arguments, recursing\n"
-       "on the directories.  If no arguments are supplied to such a\n"
-       "command, it will recurse on the current directory (inclusive) by\n" 
-       "default.\n"
-       "\n"
-       "Available subcommands:\n");
+   N_("usage: svn <subcommand> [options] [args]\n"
+      "Type 'svn help <subcommand>' for help on a specific subcommand.\n"
+      "Type 'svn --version' to see the version number of this software.\n"
+      "\n"
+      "Most subcommands take file and/or directory arguments, recursing\n"
+      "on the directories.  If no arguments are supplied to such a\n"
+      "command, it recurses on the current directory (inclusive) by default.\n"
+      "\n"
+      "Available subcommands:\n");
 
 const char svn_cl__help_footer[] =
-    N_("Subversion is a tool for version control.\n"
-       "For additional information, see http://subversion.tigris.org/\n"
-       "\n");
+   N_("Subversion is a tool for version control.\n"
+      "For additional information, see http://subversion.tigris.org/\n"
+      "\n");
 
 
 /*** Code. ***/
Index: subversion/tests/clients/cmdline/getopt_tests_data/svn_help_stdout
===================================================================
--- subversion/tests/clients/cmdline/getopt_tests_data/svn_help_stdout  (revision 11336)
+++ subversion/tests/clients/cmdline/getopt_tests_data/svn_help_stdout  (working copy)
@@ -1,10 +1,10 @@
 usage: svn <subcommand> [options] [args]
 Type 'svn help <subcommand>' for help on a specific subcommand.
+Type 'svn --version' to see the version number of this software.
 
 Most subcommands take file and/or directory arguments, recursing
 on the directories.  If no arguments are supplied to such a
-command, it will recurse on the current directory (inclusive) by
-default.
+command, it recurses on the current directory (inclusive) by default.
 
 Available subcommands:
    add
Index: subversion/tests/clients/cmdline/getopt_tests_data/svn--help_stdout
===================================================================
--- subversion/tests/clients/cmdline/getopt_tests_data/svn--help_stdout (revision 11336)
+++ subversion/tests/clients/cmdline/getopt_tests_data/svn--help_stdout (working copy)
@@ -1,10 +1,10 @@
 usage: svn <subcommand> [options] [args]
 Type 'svn help <subcommand>' for help on a specific subcommand.
+Type 'svn --version' to see the version number of this software.
 
 Most subcommands take file and/or directory arguments, recursing
 on the directories.  If no arguments are supplied to such a
-command, it will recurse on the current directory (inclusive) by
-default.
+command, it recurses on the current directory (inclusive) by default.
 
 Available subcommands:
    add

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] make 'svn help' tell how to discover version

Posted by Julian Foad <ju...@btopenworld.com>.
kfogel@collab.net wrote:
> Does anyone have any objections to this patch?  It makes 'svn help' do
> this:
> 
>    $ svn help
>    usage: svn <subcommand> [options] [args]
>    Type 'svn help <subcommand>' for help on a specific subcommand.
>    Type 'svn --version' to see the version number of this software.
>    
>    Most subcommands take file and/or directory arguments, recursing
[...]

+0.  It's probably better to say this than not to say it, but it ought to mention (or there ought to be an obvious way to find out) that you can use "svn --version [-q|--quiet]" too.  And while we're at it, though perhaps not in the same patch, "svn help" ought not to accept "-q" and silently ignore it, which is what it does at the moment (because of implementation confusion between "svn help" and "svn --version").

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] make 'svn help' tell how to discover version

Posted by kf...@collab.net.
Garrett Rooney <ro...@electricjellyfish.net> writes:
> > That may be possible, but wasn't reporting the server version (issue
> > #1959) one of the original ideas behind the "svn version" command?
> > If "svn version" goes away and we still want that functionality, it
> > will need to find somewhere else to go.
> 
> That's fine, but to the best of my knowledge 'svn version' doesn't do
> that.  According to it's help string all it prints is the client
> version.  If we want a command that prints the sever version that
> would be just fine by me, but that's not what svn version is doing now.

In addition to the possibility of printing the server version in the
future, the current 'svn version' command also prints *much* more
information than just the version number.

So I don't think there's any reason to remove that subcommand from the
list, just because we're going to show the version number in the help
output.

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] make 'svn help' tell how to discover version

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
Michael W Thelen wrote:
> Garrett Rooney wrote:
> 
>>> The following patch implements that, and passes 'make check'.  And it
>>> actually buys us back a line of vertical space, by rewording one
>>> paragraph *and* removing the extra newline at the end of the help
>>> output.
>>>
>>> Comments welcome.  I'll commit if there are no objections.
>>
>>
>> If we're going to include it in the help output (which I think is a 
>> great idea BTW) can we get rid of the 'svn version' command and lower 
>> our subcommand count a bit?
> 
> 
> That may be possible, but wasn't reporting the server version (issue 
> #1959) one of the original ideas behind the "svn version" command?  If 
> "svn version" goes away and we still want that functionality, it will 
> need to find somewhere else to go.

That's fine, but to the best of my knowledge 'svn version' doesn't do 
that.  According to it's help string all it prints is the client 
version.  If we want a command that prints the sever version that would 
be just fine by me, but that's not what svn version is doing now.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] make 'svn help' tell how to discover version

Posted by Michael W Thelen <th...@cs.utah.edu>.
Garrett Rooney wrote:
>> The following patch implements that, and passes 'make check'.  And it
>> actually buys us back a line of vertical space, by rewording one
>> paragraph *and* removing the extra newline at the end of the help
>> output.
>>
>> Comments welcome.  I'll commit if there are no objections.
> 
> If we're going to include it in the help output (which I think is a 
> great idea BTW) can we get rid of the 'svn version' command and lower 
> our subcommand count a bit?

That may be possible, but wasn't reporting the server version (issue 
#1959) one of the original ideas behind the "svn version" command?  If 
"svn version" goes away and we still want that functionality, it will 
need to find somewhere else to go.

-- 
Michael W Thelen
It is a mistake to think you can solve any major problems just with
potatoes.       -- Douglas Adams

Re: [PATCH] make 'svn help' tell how to discover version

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
kfogel@collab.net wrote:

> I think that's a good idea anyway.
> 
>     $ svn help
>     usage: svn <subcommand> [options] [args]
>     Subversion command-line client, version 1.1.0.
>     Type 'svn help <subcommand>' for help on a specific subcommand.
> 
>     Available subcommands:
>       [...]
> 
> The following patch implements that, and passes 'make check'.  And it
> actually buys us back a line of vertical space, by rewording one
> paragraph *and* removing the extra newline at the end of the help
> output.
> 
> Comments welcome.  I'll commit if there are no objections.

If we're going to include it in the help output (which I think is a 
great idea BTW) can we get rid of the 'svn version' command and lower 
our subcommand count a bit?

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] make 'svn help' tell how to discover version

Posted by kf...@collab.net.
Greg Hudson <gh...@MIT.EDU> writes:
> On Tue, 2004-10-12 at 16:11, kfogel@collab.net wrote:
> >    $ svn help
> >    usage: svn <subcommand> [options] [args]
> >    Type 'svn help <subcommand>' for help on a specific subcommand.
> >    Type 'svn --version' to see the version number of this software.
> 
> If we're spending a command name on the "version" command, why also
> spend a "svn help" line on documenting svn --version, which does the
> same thing?

My goodness.  I had totally forgotten about the 'version' subcommand,
and because I just upgraded my box and hadn't yet installed a
development Subversion, when I ran 'svn help', that subcommand wasn't
listed.  Sigh.

> (On the other hand, I wouldn't object to spending an "svn help" line on
> spitting out the svn -q --version output direcetly.)

I think that's a good idea anyway.

    $ svn help
    usage: svn <subcommand> [options] [args]
    Subversion command-line client, version 1.1.0.
    Type 'svn help <subcommand>' for help on a specific subcommand.

    Available subcommands:
      [...]

The following patch implements that, and passes 'make check'.  And it
actually buys us back a line of vertical space, by rewording one
paragraph *and* removing the extra newline at the end of the help
output.

Comments welcome.  I'll commit if there are no objections.

[[[
Make 'svn help' output show the client version number.  
Thanks to Greg Hudson for feedback.

* subversion/clients/cmdline/help-cmd.c
  (svn_cl__help_header): Add a line giving the client version.
    Then tweak a wording later on, to save a line, so the total number
    of lines in the help output remains the same.  This involved
    reformatting the source so as to make the strings start in an
    earlier column, which in turn makes this change appear more
    drastic than it actually is. 
  (svn_cl__help_footer): Make the same start-column adjustment as
    above, for consistency, and remove the extra newline at the end.
    No semantic changes.

* subversion/tests/clients/cmdline/getopt_tests.py
  (rep_lines_res): Add line to compensate for above.

* subversion/tests/clients/cmdline/getopt_tests_data/svn--help_stdout,
  subversion/tests/clients/cmdline/getopt_tests_data/svn_help_stdout:
    Adjust for new help output.
]]]

Index: subversion/clients/cmdline/help-cmd.c
===================================================================
--- subversion/clients/cmdline/help-cmd.c	(revision 11360)
+++ subversion/clients/cmdline/help-cmd.c	(working copy)
@@ -32,20 +32,19 @@
 #include "svn_private_config.h"
 
 const char svn_cl__help_header[] =
-    N_("usage: svn <subcommand> [options] [args]\n"
-       "Type 'svn help <subcommand>' for help on a specific subcommand.\n"
-       "\n"
-       "Most subcommands take file and/or directory arguments, recursing\n"
-       "on the directories.  If no arguments are supplied to such a\n"
-       "command, it will recurse on the current directory (inclusive) by\n" 
-       "default.\n"
-       "\n"
-       "Available subcommands:\n");
+   N_("usage: svn <subcommand> [options] [args]\n"
+      "Subversion command-line client, version " SVN_VER_NUMBER ".\n"
+      "Type 'svn help <subcommand>' for help on a specific subcommand.\n"
+      "\n"
+      "Most subcommands take file and/or directory arguments, recursing\n"
+      "on the directories.  If no arguments are supplied to such a\n"
+      "command, it recurses on the current directory (inclusive) by default.\n"
+      "\n"
+      "Available subcommands:\n");
 
 const char svn_cl__help_footer[] =
-    N_("Subversion is a tool for version control.\n"
-       "For additional information, see http://subversion.tigris.org/\n"
-       "\n");
+   N_("Subversion is a tool for version control.\n"
+      "For additional information, see http://subversion.tigris.org/\n");
 
 
 /*** Code. ***/
Index: subversion/tests/clients/cmdline/getopt_tests.py
===================================================================
--- subversion/tests/clients/cmdline/getopt_tests.py	(revision 11360)
+++ subversion/tests/clients/cmdline/getopt_tests.py	(working copy)
@@ -73,6 +73,13 @@
                  # In 'svn --version --quiet', we print only the version
                  # number in a single line.
                  (re.compile(r'^\d+\.\d+\.\d+(-[a-zA-Z0-9]+)?$'), 'X.Y.Z\n'),
+                 # 'svn --help' has a line with the version number.
+                 # It can vary, for example:
+                 # "Subversion command-line client, version 1.1.0."
+                 # "Subversion command-line client, version 1.1.0-dev."
+                 (re.compile(r'Subversion command-line client, '
+                             'version \d+\.\d+\.\d+(.|-[a-zA-Z0-9]+\.)$'),
+                  'Subversion command-line client, version X.Y.Z.'),
                 ]
 
 def process_lines(lines):
Index: subversion/tests/clients/cmdline/getopt_tests_data/svn_help_stdout
===================================================================
--- subversion/tests/clients/cmdline/getopt_tests_data/svn_help_stdout	(revision 11360)
+++ subversion/tests/clients/cmdline/getopt_tests_data/svn_help_stdout	(working copy)
@@ -1,10 +1,10 @@
 usage: svn <subcommand> [options] [args]
+Subversion command-line client, version X.Y.Z.
 Type 'svn help <subcommand>' for help on a specific subcommand.
 
 Most subcommands take file and/or directory arguments, recursing
 on the directories.  If no arguments are supplied to such a
-command, it will recurse on the current directory (inclusive) by
-default.
+command, it recurses on the current directory (inclusive) by default.
 
 Available subcommands:
    add
@@ -39,4 +39,3 @@
 
 Subversion is a tool for version control.
 For additional information, see http://subversion.tigris.org/
-
Index: subversion/tests/clients/cmdline/getopt_tests_data/svn--help_stdout
===================================================================
--- subversion/tests/clients/cmdline/getopt_tests_data/svn--help_stdout	(revision 11360)
+++ subversion/tests/clients/cmdline/getopt_tests_data/svn--help_stdout	(working copy)
@@ -1,10 +1,10 @@
 usage: svn <subcommand> [options] [args]
+Subversion command-line client, version X.Y.Z.
 Type 'svn help <subcommand>' for help on a specific subcommand.
 
 Most subcommands take file and/or directory arguments, recursing
 on the directories.  If no arguments are supplied to such a
-command, it will recurse on the current directory (inclusive) by
-default.
+command, it recurses on the current directory (inclusive) by default.
 
 Available subcommands:
    add
@@ -39,4 +39,3 @@
 
 Subversion is a tool for version control.
 For additional information, see http://subversion.tigris.org/
-

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] make 'svn help' tell how to discover version

Posted by Greg Hudson <gh...@MIT.EDU>.
On Tue, 2004-10-12 at 16:11, kfogel@collab.net wrote:
>    $ svn help
>    usage: svn <subcommand> [options] [args]
>    Type 'svn help <subcommand>' for help on a specific subcommand.
>    Type 'svn --version' to see the version number of this software.

If we're spending a command name on the "version" command, why also
spend a "svn help" line on documenting svn --version, which does the
same thing?

(On the other hand, I wouldn't object to spending an "svn help" line on
spitting out the svn -q --version output direcetly.)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org