]> asedeno.scripts.mit.edu Git - git.git/commitdiff
Fix documentation syntax of optional arguments in short options.
authorCarlos Rica <jasampler@gmail.com>
Wed, 9 Apr 2008 11:07:14 +0000 (13:07 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 10 Apr 2008 07:20:31 +0000 (00:20 -0700)
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>
Documentation/git-tag.txt
builtin-tag.c
parse-options.c

index b62a3d1c5896a3b2e32af58029115240d609f37b..74b461f66194be5abc944c9feeb8666125955d82 100644 (file)
@@ -11,7 +11,7 @@ SYNOPSIS
 [verse]
 'git-tag' [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>]  <name> [<head>]
 'git-tag' -d <name>...
-'git-tag' [-n [<num>]] -l [<pattern>]
+'git-tag' [-n[<num>]] -l [<pattern>]
 'git-tag' -v <name>...
 
 DESCRIPTION
@@ -54,7 +54,7 @@ OPTIONS
 -v::
        Verify the gpg signature of the given tag names.
 
--n <num>::
+-n<num>::
        <num> specifies how many lines from the annotation, if any,
        are printed when using -l.
        The default is not to print any annotation lines.
index 9a59caf70d74cae9b7eae858402233ad6f7c3984..95ecfdbab650f3b60bb3ecb7e20f68a913470d20 100644 (file)
@@ -16,7 +16,7 @@
 static const char * const git_tag_usage[] = {
        "git-tag [-a|-s|-u <key-id>] [-f] [-m <msg>|-F <file>] <tagname> [<head>]",
        "git-tag -d <tagname>...",
-       "git-tag -l [-n [<num>]] [<pattern>]",
+       "git-tag -l [-n[<num>]] [<pattern>]",
        "git-tag -v <tagname>...",
        NULL
 };
index d9562ba5047ff1c9994755a4dbec5162b551c788..59dc9ce6b471c61aff22d51293ee3d74b020c88a 100644 (file)
@@ -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, " [<n>]");
+                               pos += fprintf(stderr, "[<n>]");
                        else
                                pos += fprintf(stderr, " <n>");
                        break;