Skip to content

Commit 3f36cbb

Browse files
jasamplergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ee5a317 commit 3f36cbb

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Documentation/git-tag.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ SYNOPSIS
1111
[verse]
1212
'git-tag' [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] <name> [<head>]
1313
'git-tag' -d <name>...
14-
'git-tag' [-n [<num>]] -l [<pattern>]
14+
'git-tag' [-n[<num>]] -l [<pattern>]
1515
'git-tag' -v <name>...
1616

1717
DESCRIPTION
@@ -54,7 +54,7 @@ OPTIONS
5454
-v::
5555
Verify the gpg signature of the given tag names.
5656

57-
-n <num>::
57+
-n<num>::
5858
<num> specifies how many lines from the annotation, if any,
5959
are printed when using -l.
6060
The default is not to print any annotation lines.

builtin-tag.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
static const char * const git_tag_usage[] = {
1717
"git-tag [-a|-s|-u <key-id>] [-f] [-m <msg>|-F <file>] <tagname> [<head>]",
1818
"git-tag -d <tagname>...",
19-
"git-tag -l [-n [<num>]] [<pattern>]",
19+
"git-tag -l [-n[<num>]] [<pattern>]",
2020
"git-tag -v <tagname>...",
2121
NULL
2222
};

parse-options.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ void usage_with_options_internal(const char * const *usagestr,
330330
switch (opts->type) {
331331
case OPTION_INTEGER:
332332
if (opts->flags & PARSE_OPT_OPTARG)
333-
pos += fprintf(stderr, " [<n>]");
333+
pos += fprintf(stderr, "[<n>]");
334334
else
335335
pos += fprintf(stderr, " <n>");
336336
break;

0 commit comments

Comments
 (0)