From: Junio C Hamano Date: Mon, 09 Apr 2012 22:06:32 GMT Subject: Re: [PATCH] remote: update builtin usage Message-ID: <7vty0stv9z.fsf@alter.siamese.dyndns.org> In-Reply-To: <4F804E70.2020106@elegosoft.com> Michael Schubert writes: > Add missing options "--tags|--no-tags" and "--push". > > Signed-off-by: Michael Schubert > --- > builtin/remote.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/builtin/remote.c b/builtin/remote.c > index fec92bc..b5645fe 100644 > --- a/builtin/remote.c > +++ b/builtin/remote.c > @@ -9,7 +9,7 @@ > > static const char * const builtin_remote_usage[] = { > "git remote [-v | --verbose]", > - "git remote add [-t ] [-m ] [-f] [--mirror=] ", > + "git remote add [-t ] [-m ] [-f] [--tags|--no-tags] [--mirror=] ", > "git remote rename ", > "git remote rm ", > "git remote set-head (-a | -d | )", > @@ -17,7 +17,7 @@ static const char * const builtin_remote_usage[] = { > "git remote prune [-n | --dry-run] ", > "git remote [-v | --verbose] update [-p | --prune] [( | )...]", > "git remote set-branches [--add] ...", > - "git remote set-url []", > + "git remote set-url [--push] []", > "git remote set-url --add ", > "git remote set-url --delete ", > NULL Hrm. While this may not be _wrong_ per-se, it strikes me odd that builtin_remote_usage[] is more or less a superset of the subcommand specific usage text, e.g. builtin_remote_seturl_usage[], etc., but still need to be manually defined like this. That always leaves a risk that the descriptions would drift apart between the two places. For example, builtin_remote_setbranches_usage[] has these two: static const char * const builtin_remote_setbranches_usage[] = { "git remote set-branches ...", "git remote set-branches --add ...", NULL }; where the above has only one, with an optional "[--add]". There must be a better way to do this.