git remote: Separate usage strings for subcommands
PATCH v5 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 complete options list from the first line of the subcommand usage string. Instead, individual options are documented in the detailed description following the general usage line.
---
This patch is based on:
http://article.gmane.org/gmane.comp.version-control.git/132953
After some misunderstanding on my part, this version of the patch should be correct. The following snippet [1] explains the intent:
Quoted 14 lines
Quoted 13 lines · Junio C Hamano
Tim Henigan <[email protected]> writes:
Using the 'add' subcommand as an example, the desired output is:
Output of 'git remote -h':
"git remote [-v | --verbose]" "git remote add [-t <branch>] [-m <master>] [-f] [--mirror] <name> <url>" etc.Output of 'git remote add -h':
"git remote add [<options>...] <name> <url>"
followed by the detailed description given by 'parse_options()'.
Quoted 7 lines
Quoted 5 lines
Text in 'man git-remote':
"git remote add [-t <branch>] [-m <master>] [-f] [--mirror] <name> <url>" with the options explained in detail later in the file.Thanks for your patience,
I think the above looks good;
[1]: http://thread.gmane.org/gmane.comp.version-control.git/133209/focus=133243
Documentation/git-remote.txt | 7 ++-- builtin-remote.c | 66 ++++++++++++++++++++++++++++++----------- 2 files changed, 52 insertions(+), 21 deletions(-)
Documentation/git-remote.txt +4 -3
@@ -13,10 +13,10 @@ SYNOPSIS 'git remote add' [-t <branch>] [-m <master>] [-f] [--mirror] <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 set-head' <name> (-a | -d | <branch>) +'git remote' [-v | --verbose] 'show' [-n] <name> 'git remote prune' [-n | --dry-run] <name> -'git remote update' [-p | --prune] [group | remote]... +'git remote' [-v | --verbose] 'update' [-p | --prune] [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 +48 -18
164 lines not on this page · raw message
Signature · 1 line
1.6.5.2.186.g3ccc3