git remote: Separate usage strings for subcommands
PATCH v3 1/1 git remote: Separate usage strings for subcommands
When the usage string for a subcommand must be printed, only print the information relevant to that command.
This commit also removes the options from the first line of the usage string (replacing them with '<options>...' and lets them be documented in the paragraph below.
---
This patch is based on:
http://article.gmane.org/gmane.comp.version-control.git/132953
All usage strings are still only located at the top of file. However, separate usage string arrays have been created for each subcommand.
v2 fixed line wrap issues present in v1.
v3 changes include:
- Changed usage strings to use '<options>...' rather than document the options both in the actual string and in the OPT_x array (as recommended by Junio).
- Removed the change made to the usage string array constructed in 'cmd_remote'. v2 was broken because that change had made the command stop recognizing the '-v' option. Added an extra note here which explains that '-v' is only valid when placed after 'git remote' and before any 'subcommand'.
- Updated the man page.
Documentation/git-remote.txt | 13 +++++---- builtin-remote.c | 58 ++++++++++++++++++++++++++---------------- 2 files changed, 43 insertions(+), 28 deletions(-)
Documentation/git-remote.txt +7 -6
@@ -9,14 +9,14 @@ git-remote - manage set of tracked repositories SYNOPSIS -------- [verse] -'git remote' [-v | --verbose] -'git remote add' [-t <branch>] [-m <master>] [-f] [--mirror] <name> <url> +'git remote' [<options>...] +'git remote add' [<options>...] <name> <url> 'git remote rename' <old> <new> 'git remote rm' <name> -'git remote set-head' <name> [-a | -d | <branch>] -'git remote show' [-n] <name> -'git remote prune' [-n | --dry-run] <name> -'git remote update' [-p | --prune] [group | remote]... +'git remote set-head' <name> [<options>...] +'git remote show' [<options>...] <name> +'git remote prune' [<options>...] <name> +'git remote update' [<options>...] [group | remote]... DESCRIPTION -----------
@@ -30,6 +30,7 @@ OPTIONS -v:: --verbose:: Be a little more verbose and show remote url after name. + NOTE: This must be placed between `remote` and `subcommand`. COMMANDS
builtin-remote.c +36 -22
143 lines not on this page · raw message
Signature · 1 line
1.6.5.2.186.g868bf.dirty