From 3f36cbbaaf87b67abafa851e2808735553f92b06 Mon Sep 17 00:00:00 2001 From: Carlos Rica Date: Wed, 9 Apr 2008 13:07:14 +0200 Subject: [PATCH] Fix documentation syntax of optional arguments in short options. When an argument for an option is optional, like in -n from git-tag, puting a space between the option and the argument is interpreted as a missing argument for the option plus an isolated argument. Documentation now reflects the need to write the parameter following the option -n, as in "git tag -nARG", for instance. Signed-off-by: Carlos Rica Signed-off-by: Junio C Hamano --- Documentation/git-tag.txt | 4 ++-- builtin-tag.c | 2 +- parse-options.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt index b62a3d1c58..74b461f661 100644 --- a/Documentation/git-tag.txt +++ b/Documentation/git-tag.txt @@ -11,7 +11,7 @@ SYNOPSIS [verse] 'git-tag' [-a | -s | -u ] [-f] [-m | -F ] [] 'git-tag' -d ... -'git-tag' [-n []] -l [] +'git-tag' [-n[]] -l [] 'git-tag' -v ... DESCRIPTION @@ -54,7 +54,7 @@ OPTIONS -v:: Verify the gpg signature of the given tag names. --n :: +-n:: specifies how many lines from the annotation, if any, are printed when using -l. The default is not to print any annotation lines. diff --git a/builtin-tag.c b/builtin-tag.c index 9a59caf70d..95ecfdbab6 100644 --- a/builtin-tag.c +++ b/builtin-tag.c @@ -16,7 +16,7 @@ static const char * const git_tag_usage[] = { "git-tag [-a|-s|-u ] [-f] [-m |-F ] []", "git-tag -d ...", - "git-tag -l [-n []] []", + "git-tag -l [-n[]] []", "git-tag -v ...", NULL }; diff --git a/parse-options.c b/parse-options.c index d9562ba504..59dc9ce6b4 100644 --- a/parse-options.c +++ b/parse-options.c @@ -330,7 +330,7 @@ void usage_with_options_internal(const char * const *usagestr, switch (opts->type) { case OPTION_INTEGER: if (opts->flags & PARSE_OPT_OPTARG) - pos += fprintf(stderr, " []"); + pos += fprintf(stderr, "[]"); else pos += fprintf(stderr, " "); break; -- 2.11.4.GIT