@matheusbsbs / matheus-bagliano / commits / 3f36cbbaaf
Fork 0

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 <jasampler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Carlos Rica committed Apr 9, 2008 at 13:07 UTC 3f36cbbaaf87b67abafa851e2808735553f92b06
3 files changed +4 -4
Documentation/git-tag.txt
+2 -2
@@ -11,7 +11,7 @@ SYNOPSIS
11 [verse]
12 'git-tag' [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] <name> [<head>]
13 'git-tag' -d <name>...
14 -'git-tag' [-n [<num>]] -l [<pattern>]
14 +'git-tag' [-n[<num>]] -l [<pattern>]
15 'git-tag' -v <name>...
16
17 DESCRIPTION
@@ -54,7 +54,7 @@ OPTIONS
54 -v::
55 Verify the gpg signature of the given tag names.
56
57 --n <num>::
57 +-n<num>::
58 <num> specifies how many lines from the annotation, if any,
59 are printed when using -l.
60 The default is not to print any annotation lines.
builtin-tag.c
+1 -1
@@ -16,7 +16,7 @@
16 static const char * const git_tag_usage[] = {
17 "git-tag [-a|-s|-u <key-id>] [-f] [-m <msg>|-F <file>] <tagname> [<head>]",
18 "git-tag -d <tagname>...",
19 - "git-tag -l [-n [<num>]] [<pattern>]",
19 + "git-tag -l [-n[<num>]] [<pattern>]",
20 "git-tag -v <tagname>...",
21 NULL
22 };
parse-options.c
+1 -1
@@ -330,7 +330,7 @@ void usage_with_options_internal(const char * const *usagestr,
330 switch (opts->type) {
331 case OPTION_INTEGER:
332 if (opts->flags & PARSE_OPT_OPTARG)
333 - pos += fprintf(stderr, " [<n>]");
333 + pos += fprintf(stderr, "[<n>]");
334 else
335 pos += fprintf(stderr, " <n>");
336 break;