cmpilato@collab.net wrote:
> Julian Foad <julianfoad@btopenworld.com> writes:
>
>>Well, I don't mind either way. Here is the patch the way you prefer it.
>
> Now, perhaps try one more time, the way *I* prefer it.
>
> a) with a log message, and
Oops... I forgot that. Here it is, adjusted to match the "dots inside" version of the patch.
Log message: ------------------------------------------------------------------]
Two improvements to the help text of the command-line client and utilities:
1. To reduce inconsistency and repetition, simplify the specification of
arguments that can be repeated, by writing
"TARGET..." instead of things like "TARGET [TARGET [TARGET ... ]]" and
"[TARGET...]" instead of things like "[TARGET [TARGET ... ]]".
2. In the usage message for the "help" command (which is displayed when the
two arguments "help help" are given), the three utilities were all referring
to themselves as "svn". Fixed them to say "svnlook" etc. as appropriate.
* subversion/svnadmin/main.c
* subversion/svnlook/main.c
* subversion/svndumpfilter/main.c
(cmd_table): Simplify the specification of repeated arguments.
Fix the program name in the "help help" usage message.
* subversion/clients/cmdline/main.c
(svn_cl__cmd_table): Simplify the specification of repeated arguments.
> b) not causing some of the getopt_test.py tests to fail.
Good grief. I didn't think the usage messages would be tested. Note to self: DON'T THINK; JUST RUN THE TESTS.
The attached patch now includes the corresponding modifications to expected test results, and passes at least the first 22 groups of tests (which includes getopt_tests.py and goes up to diff_tests.py).
Thanks for your patience.
- Julian
Index: subversion/svnadmin/main.c
===================================================================
--- subversion/svnadmin/main.c (revision 6346)
+++ subversion/svnadmin/main.c (working copy)
@@ -164,7 +164,7 @@
{'r', svnadmin__incremental, 'q'} },
{"help", subcommand_help, {"?", "h"},
- "usage: svn help [SUBCOMMAND1 [SUBCOMMAND2] ...]\n\n"
+ "usage: svnadmin help [SUBCOMMAND...]\n\n"
"Display this usage message.\n",
{svnadmin__version} },
@@ -201,7 +201,7 @@
{0} },
{"rmtxns", subcommand_rmtxns, {0},
- "usage: svnadmin rmtxns REPOS_PATH TXN_NAME [TXN_NAME2 ...]\n\n"
+ "usage: svnadmin rmtxns REPOS_PATH TXN_NAME...\n\n"
"Delete the named transaction(s).\n",
{0} },
Index: subversion/svnlook/main.c
===================================================================
--- subversion/svnlook/main.c (revision 6346)
+++ subversion/svnlook/main.c (working copy)
@@ -151,7 +151,7 @@
{'r', 't'} },
{"help", subcommand_help, {"?", "h"},
- "usage: svn help [SUBCOMMAND1 [SUBCOMMAND2] ...]\n\n"
+ "usage: svnlook help [SUBCOMMAND...]\n\n"
"Display this usage message.\n",
{svnlook__version} },
Index: subversion/clients/cmdline/main.c
===================================================================
--- subversion/clients/cmdline/main.c (revision 6346)
+++ subversion/clients/cmdline/main.c (working copy)
@@ -146,17 +146,17 @@
{ "add", svn_cl__add, {0},
"Put files and directories under revision control, scheduling\n"
"them for addition to repository. They will be added in next commit.\n"
- "usage: add PATH [PATH [PATH ... ]]\n",
+ "usage: add PATH...\n",
{svn_cl__targets_opt, 'N', 'q'} },
{ "cat", svn_cl__cat, {0},
"Output the content of specified files or URLs.\n"
- "usage: cat TARGET [TARGET [TARGET ... ]]\n",
+ "usage: cat TARGET...\n",
{'r', SVN_CL__AUTH_OPTIONS} },
{ "checkout", svn_cl__checkout, {"co"},
"Check out a working copy from a repository.\n"
- "usage: checkout URL [URL [URL ... ]] [PATH]\n"
+ "usage: checkout URL... [PATH]\n"
" Note: If PATH is omitted, the basename of the URL will be used as\n"
" the destination. If multiple URLs are given each will be checked\n"
" out into a sub-directory of PATH, with the name of the sub-directory\n"
@@ -166,12 +166,12 @@
{ "cleanup", svn_cl__cleanup, {0},
"Recursively clean up the working copy, removing locks, resuming\n"
"unfinished operations, etc.\n"
- "usage: cleanup [PATH [PATH ... ]]\n",
+ "usage: cleanup [PATH...]\n",
{0} },
{ "commit", svn_cl__commit, {"ci"},
"Send changes from your working copy to the repository.\n"
- "usage: commit [PATH [PATH ... ]]\n\n"
+ "usage: commit [PATH...]\n\n"
" Be sure to use one of -m or -F to send a log message.\n",
{'m', 'F', 'q', 'N', svn_cl__targets_opt,
svn_cl__force_log_opt, SVN_CL__AUTH_OPTIONS,
@@ -190,8 +190,8 @@
{ "delete", svn_cl__delete, {"del", "remove", "rm"},
"Remove files and directories from version control.\n"
- "usage: 1. delete PATH [PATH ... ]\n"
- " 2. delete URL [URL ...]\n\n"
+ "usage: 1. delete PATH...\n"
+ " 2. delete URL...\n\n"
" If run on a working copy PATHs, each item is scheduled for deletion\n"
" upon the next commit. Files, and directories that have not been\n"
" committed, are immediately removed from the working copy. The\n"
@@ -206,7 +206,7 @@
{ "diff", svn_cl__diff, {"di"},
"display the differences between two paths.\n"
- "usage: 1. diff [-r N[:M]] [--old OLD-TGT] [--new NEW-TGT] [PATH ...]\n"
+ "usage: 1. diff [-r N[:M]] [--old OLD-TGT] [--new NEW-TGT] [PATH...]\n"
" 2. diff -r N:M URL\n"
" 3. diff [-r N[:M]] URL1[@N] URL2[@M]\n\n"
" 1. Display the differences between OLD-TGT and NEW-TGT. PATHs, if\n"
@@ -241,7 +241,7 @@
{ "help", svn_cl__help, {"?", "h"},
"Display this usage message.\n"
- "usage: help [SUBCOMMAND [SUBCOMMAND ... ]]\n",
+ "usage: help [SUBCOMMAND...]\n",
{svn_cl__version_opt, 'q'} },
/* We need to support "--help", "-?", and all that good stuff, of
course. But those options, since unknown, will result in the
@@ -259,19 +259,19 @@
{ "info", svn_cl__info, {0},
"Display info about a resource.\n"
- "usage: info [PATH [PATH ... ]]\n\n"
+ "usage: info [PATH...]\n\n"
" Print information about PATHs.\n",
{svn_cl__targets_opt, 'R'} },
{ "list", svn_cl__ls, {"ls"},
"List directory entries of a URL.\n"
- "usage: list URL [URL ... ]\n\n"
+ "usage: list URL...\n\n"
" If URL is a file, just file entry will be displayed.\n",
{'r', 'v', 'R', SVN_CL__AUTH_OPTIONS} },
{ "log", svn_cl__log, {0},
"Show the log messages for a set of revision(s) and/or file(s).\n"
- "usage: log [URL] [PATH [PATH ... ]]\n"
+ "usage: log [URL] [PATH...]\n"
" Print the log messages for local PATHs, or for PATHs under\n"
" URL, if URL is given. If URL is given by itself, then print log\n"
" messages for everything under it. With -v, also print all affected\n"
@@ -310,8 +310,8 @@
{ "mkdir", svn_cl__mkdir, {0},
"Create a new directory under revision control.\n"
- "usage: 1. mkdir PATH [PATH ... ]\n"
- " 2. mkdir URL [URL ...]\n\n"
+ "usage: 1. mkdir PATH...\n"
+ " 2. mkdir URL...\n\n"
" Create version controlled directories.\n\n"
" If run on a working copy PATHs, each directory is scheduled for\n"
" addition upon the next commit.\n\n"
@@ -333,7 +333,7 @@
{ "propdel", svn_cl__propdel, {"pdel"},
"Remove PROPNAME from files, dirs, or revisions.\n"
- "usage: 1. propdel PROPNAME [PATH [PATH ... ]]\n"
+ "usage: 1. propdel PROPNAME [PATH...]\n"
" 2. propdel PROPNAME --revprop -r REV [URL]\n\n"
" 1. Removes versioned props in working copy.\n"
" 2. Removes unversioned remote prop on repos revision.\n",
@@ -341,7 +341,7 @@
{ "propedit", svn_cl__propedit, {"pedit", "pe"},
"Edit property PROPNAME with $EDITOR on targets.\n"
- "usage: 1. propedit PROPNAME PATH [PATH [PATH ... ]]\n"
+ "usage: 1. propedit PROPNAME PATH...\n"
" 2. propedit PROPNAME --revprop -r REV [URL]\n\n"
" 1. Edits versioned props in working copy.\n"
" 2. Edits unversioned remote prop on repos revision.\n",
@@ -350,7 +350,7 @@
{ "propget", svn_cl__propget, {"pget", "pg"},
"Print value of PROPNAME on files, dirs, or revisions.\n"
- "usage: 1. propget PROPNAME [PATH [PATH ... ]]\n"
+ "usage: 1. propget PROPNAME [PATH...]\n"
" 2. propget PROPNAME --revprop -r REV [URL]\n\n"
" 1. Prints versioned prop in working copy.\n"
" 2. Prints unversioned remote prop on repos revision.\n\n"
@@ -365,7 +365,7 @@
{ "proplist", svn_cl__proplist, {"plist", "pl"},
"List all properties on files, dirs, or revisions.\n"
- "usage: 1. proplist [PATH [PATH ... ]]\n"
+ "usage: 1. proplist [PATH...]\n"
" 2. proplist --revprop -r REV [URL]\n\n"
" 1. Lists versioned props in working copy.\n"
" 2. Lists unversioned remote props on repos revision.\n",
@@ -373,7 +373,7 @@
{ "propset", svn_cl__propset, {"pset", "ps"},
"Set PROPNAME to PROPVAL on files, dirs, or revisions.\n\n"
- "usage: 1. propset PROPNAME [PROPVAL | -F VALFILE] PATH [PATH [PATH ... ]]\n"
+ "usage: 1. propset PROPNAME [PROPVAL | -F VALFILE] PATH...\n"
" 2. propset PROPNAME --revprop -r REV [PROPVAL | -F VALFILE] [URL]\n"
"\n"
" 1. Creates a versioned, local propchange in working copy.\n"
@@ -409,14 +409,14 @@
{ "revert", svn_cl__revert, {0},
"Restore pristine working copy file (undo all local edits)\n"
- "usage: revert PATH [PATH [PATH ... ]]\n\n"
+ "usage: revert PATH...\n\n"
" Note: this routine does not require network access, and \n"
" resolves any conflicted states.\n",
{svn_cl__targets_opt, 'R', 'q'} },
{ "resolve", svn_cl__resolve, {0},
"Remove 'conflicted' state on working copy files or directories.\n"
- "usage: resolve PATH [PATH [PATH ... ]]\n\n"
+ "usage: resolve PATH...\n\n"
" Note: this routine does not semantically resolve conflict markers;\n"
" it merely removes conflict-related artifact files and allows PATH\n"
" to be committed again.\n",
@@ -424,7 +424,7 @@
{ "status", svn_cl__status, {"stat", "st"},
"Print the status of working copy files and directories.\n"
- "usage: status [PATH [PATH ... ]]\n\n"
+ "usage: status [PATH...]\n\n"
" With no args, print only locally modified items (no network access).\n"
" With -u, add working revision and server out-of-date information.\n"
" With -v, print full revision information on every item.\n"
@@ -486,14 +486,14 @@
{ "switch", svn_cl__switch, {"sw"},
"Update working copy to mirror a new URL\n"
"usage: switch URL [PATH] or\n"
- " switch --relocate FROM TO [PATH ... ]\n\n"
+ " switch --relocate FROM TO [PATH...]\n\n"
" Note: this is the way to move a working copy to a new branch.\n",
{ 'r', 'N', 'q', svn_cl__merge_cmd_opt, svn_cl__relocate_opt,
SVN_CL__AUTH_OPTIONS} },
{ "update", svn_cl__update, {"up"},
"Bring changes from the repository into the working copy.\n"
- "usage: update [PATH [PATH ... ]]\n\n"
+ "usage: update [PATH...]\n\n"
" If no revision given, bring working copy up-to-date with HEAD rev.\n"
" Else synchronize working copy to revision given by -r.\n"
"\n"
Index: subversion/svndumpfilter/main.c
===================================================================
--- subversion/svndumpfilter/main.c (revision 6346)
+++ subversion/svndumpfilter/main.c (working copy)
@@ -675,17 +675,17 @@
static const svn_opt_subcommand_desc_t cmd_table[] =
{
{"exclude", subcommand_exclude, {0},
- "usage: svndumpfilter exclude PATH_PREFIX [PATH_PREFIX ...]\n\n"
+ "usage: svndumpfilter exclude PATH_PREFIX...\n\n"
"Filter out nodes with given prefixes from dumpstream.\n",
{svndumpfilter__drop_empty_revs, svndumpfilter__renumber_revs} },
{"include", subcommand_include, {0},
- "usage: svndumpfilter include PATH_PREFIX [PATH_PREFIX ...]\n\n"
+ "usage: svndumpfilter include PATH_PREFIX...\n\n"
"Filter out nodes without given prefixes from dumpstream.\n",
{svndumpfilter__drop_empty_revs, svndumpfilter__renumber_revs} },
{"help", subcommand_help, {"?", "h"},
- "usage: svn help [SUBCOMMAND1 [SUBCOMMAND2] ...]\n\n"
+ "usage: svndumpfilter help [SUBCOMMAND...]\n\n"
"Display this usage message.\n",
{0} },
Index: subversion/tests/clients/cmdline/getopt_tests_data/svn_help--version_stdout
===================================================================
--- subversion/tests/clients/cmdline/getopt_tests_data/svn_help--version_stdout (revision 6346)
+++ subversion/tests/clients/cmdline/getopt_tests_data/svn_help--version_stdout (working copy)
@@ -1,5 +1,5 @@
help (?, h): Display this usage message.
-usage: help [SUBCOMMAND [SUBCOMMAND ... ]]
+usage: help [SUBCOMMAND...]
Valid options:
--version : print client version info
Index: subversion/tests/clients/cmdline/getopt_tests_data/svn_help_log_switch_stdout
===================================================================
--- subversion/tests/clients/cmdline/getopt_tests_data/svn_help_log_switch_stdout (revision 6346)
+++ subversion/tests/clients/cmdline/getopt_tests_data/svn_help_log_switch_stdout (working copy)
@@ -1,5 +1,5 @@
log: Show the log messages for a set of revision(s) and/or file(s).
-usage: log [URL] [PATH [PATH ... ]]
+usage: log [URL] [PATH...]
Print the log messages for local PATHs, or for PATHs under
URL, if URL is given. If URL is given by itself, then print log
messages for everything under it. With -v, also print all affected
@@ -36,7 +36,7 @@
switch (sw): Update working copy to mirror a new URL
usage: switch URL [PATH] or
- switch --relocate FROM TO [PATH ... ]
+ switch --relocate FROM TO [PATH...]
Note: this is the way to move a working copy to a new branch.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jun 27 02:58:03 2003