From: Jiang Xin Date: Sun, 03 Nov 2013 07:17:10 GMT Subject: Re: [PATCH] remote: unify main and subcommand usage strings Message-ID: In-Reply-To: 2013/11/3 Thomas Rast : > We had separate usages for each subcommand, and for the main command, > even though the latter is essentially a concatenation of all of the > former. This leads to a lot of duplication and unnecessary > differences, e.g., in the 'set-head' case the two strings differ only > in a space. > > Unify the strings in the usages by putting each of them in a variable, > and assembling the usage arrays from them. > > Note that this patch changes the usage strings for the following > subcommands: > > - prune and show: the individual usage only said []. Kept > the snippet from the main usage, which is more specific. > > - set-branches: kept the main usage, which is more concise in saying > that --add is optional > Differences of git-remote usages after applied your patch. diff -u before/git-remote-add-usage after/git-remote-add-usage --- before/git-remote-add-usage 2013-11-03 15:10:06.000000000 +0800 +++ after/git-remote-add-usage 2013-11-03 15:11:32.000000000 +0800 @@ -1,4 +1,4 @@ -usage: git remote add [] +usage: git remote add [-t ] [-m ] [-f] [--tags|--no-tags] [--mirror=] -f, --fetch fetch the remote branches --tags import all tags and associated objects when fetching diff -u before/git-remote-prune-usage after/git-remote-prune-usage --- before/git-remote-prune-usage 2013-11-03 15:10:06.000000000 +0800 +++ after/git-remote-prune-usage 2013-11-03 15:11:32.000000000 +0800 @@ -1,4 +1,4 @@ -usage: git remote prune [] +usage: git remote prune [-n | --dry-run] -n, --dry-run dry run diff -u before/git-remote-set-branches-usage after/git-remote-set-branches-usage --- before/git-remote-set-branches-usage 2013-11-03 15:10:06.000000000 +0800 +++ after/git-remote-set-branches-usage 2013-11-03 15:11:32.000000000 +0800 @@ -1,5 +1,4 @@ -usage: git remote set-branches ... - or: git remote set-branches --add ... +usage: git remote set-branches [--add] ... --add add branch diff -u before/git-remote-show-usage after/git-remote-show-usage --- before/git-remote-show-usage 2013-11-03 15:10:06.000000000 +0800 +++ after/git-remote-show-usage 2013-11-03 15:11:32.000000000 +0800 @@ -1,4 +1,4 @@ -usage: git remote show [] +usage: git remote [-v | --verbose] show [-n] -n do not query remotes diff -u before/git-remote-update-usage after/git-remote-update-usage --- before/git-remote-update-usage 2013-11-03 15:10:06.000000000 +0800 +++ after/git-remote-update-usage 2013-11-03 15:11:32.000000000 +0800 @@ -1,4 +1,4 @@ -usage: git remote update [] [ | ]... +usage: git remote [-v | --verbose] update [-p | --prune] [( | )...] -p, --prune prune remotes after fetching -- Jiang Xin