{"thread":{"id":"13033","subject":"[PATCH] Fix documentation syntax of optional arguments in short options.","startedAt":"2008-04-09T04:24:48Z","lastAt":"2008-04-09T11:07:14Z","messageCount":2,"participants":["Carlos Rica"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"73918","messageId":"47FC4510.6080904@gmail.com","threadId":"13033","inReplyTo":null,"subject":"[PATCH] Fix documentation syntax of optional arguments in short options.","fromName":"Carlos Rica","fromEmail":"jasampler@gmail.com","sentAt":"2008-04-09T04:24:48Z","receivedAt":"2008-04-09T04:24:48Z","isPatch":true,"sender":{"key":"jasampler@gmail.com","avatar":null},"body":"When an argument for an option is optional, like in -n from git-tag,\nputting a space between the option and the argument is interpreted\nas a missing argument for the option plus an isolated argument.\nDocumentation now reflects the need to write the parameter following\nthe option -n, as in \"git tag -nARG\", for instance.\n\nSigned-off-by: Carlos Rica <jasampler@gmail.com>\n---\n Documentation/git-tag.txt |    4 ++--\n parse-options.c           |    2 +-\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt\nindex c22fb71..4b6fd90 100644\n--- a/Documentation/git-tag.txt\n+++ b/Documentation/git-tag.txt\n@@ -11,7 +11,7 @@ SYNOPSIS\n [verse]\n 'git-tag' [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>]  <name> [<head>]\n 'git-tag' -d <name>...\n-'git-tag' [-n [<num>]] -l [<pattern>]\n+'git-tag' [-n[<num>]] -l [<pattern>]\n 'git-tag' -v <name>...\n\n DESCRIPTION\n@@ -57,7 +57,7 @@ OPTIONS\n -v::\n \tVerify the gpg signature of the given tag names.\n\n--n <num>::\n+-n<num>::\n \t<num> specifies how many lines from the annotation, if any,\n \tare printed when using -l.\n \tThe default is not to print any annotation lines.\ndiff --git a/parse-options.c b/parse-options.c\nindex e87cafb..acf3fe3 100644\n--- a/parse-options.c\n+++ b/parse-options.c\n@@ -344,7 +344,7 @@ void usage_with_options_internal(const char * const *usagestr,\n \t\t\tbreak;\n \t\tcase OPTION_INTEGER:\n \t\t\tif (opts->flags & PARSE_OPT_OPTARG)\n-\t\t\t\tpos += fprintf(stderr, \" [<n>]\");\n+\t\t\t\tpos += fprintf(stderr, \"[<n>]\");\n \t\t\telse\n \t\t\t\tpos += fprintf(stderr, \" <n>\");\n \t\t\tbreak;\n-- \n1.5.3.4\n"},{"id":"73951","messageId":"47FCA362.3090607@gmail.com","threadId":"13033","inReplyTo":"47FC4510.6080904@gmail.com","subject":"Re: [PATCH] Fix documentation syntax of optional arguments in short options.","fromName":"Carlos Rica","fromEmail":"jasampler@gmail.com","sentAt":"2008-04-09T11:07:14Z","receivedAt":"2008-04-09T11:07:14Z","isPatch":true,"sender":{"key":"jasampler@gmail.com","avatar":null},"body":"When an argument for an option is optional, like in -n from git-tag,\nputing a space between the option and the argument is interpreted\nas a missing argument for the option plus an isolated argument.\nDocumentation now reflects the need to write the parameter following\nthe option -n, as in \"git tag -nARG\", for instance.\n\nSigned-off-by: Carlos Rica <jasampler@gmail.com>\n---\n\n   I forgot to make the same change to the command's syntax in builtin-tag.c.\n\n   I didn't check if this also happens for OPTION_STRING, this is only for\n   OPTION_INTEGER, which seems to be only used in git-tag. I must note that\n   all this is related to the PARSE_OPT_OPTARG option, which is used only\n   (apart from builtin-tag.c) in builtin-rev-parse.c but in a different way.\n\n Documentation/git-tag.txt |    4 ++--\n builtin-tag.c             |    2 +-\n parse-options.c           |    2 +-\n 3 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt\nindex c22fb71..4b6fd90 100644\n--- a/Documentation/git-tag.txt\n+++ b/Documentation/git-tag.txt\n@@ -11,7 +11,7 @@ SYNOPSIS\n [verse]\n 'git-tag' [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>]  <name> [<head>]\n 'git-tag' -d <name>...\n-'git-tag' [-n [<num>]] -l [<pattern>]\n+'git-tag' [-n[<num>]] -l [<pattern>]\n 'git-tag' -v <name>...\n\n DESCRIPTION\n@@ -57,7 +57,7 @@ OPTIONS\n -v::\n \tVerify the gpg signature of the given tag names.\n\n--n <num>::\n+-n<num>::\n \t<num> specifies how many lines from the annotation, if any,\n \tare printed when using -l.\n \tThe default is not to print any annotation lines.\ndiff --git a/builtin-tag.c b/builtin-tag.c\nindex 8dd959f..129ff57 100644\n--- a/builtin-tag.c\n+++ b/builtin-tag.c\n@@ -16,7 +16,7 @@\n static const char * const git_tag_usage[] = {\n \t\"git-tag [-a|-s|-u <key-id>] [-f] [-m <msg>|-F <file>] <tagname> [<head>]\",\n \t\"git-tag -d <tagname>...\",\n-\t\"git-tag -l [-n [<num>]] [<pattern>]\",\n+\t\"git-tag -l [-n[<num>]] [<pattern>]\",\n \t\"git-tag -v <tagname>...\",\n \tNULL\n };\ndiff --git a/parse-options.c b/parse-options.c\nindex e87cafb..acf3fe3 100644\n--- a/parse-options.c\n+++ b/parse-options.c\n@@ -344,7 +344,7 @@ void usage_with_options_internal(const char * const *usagestr,\n \t\t\tbreak;\n \t\tcase OPTION_INTEGER:\n \t\t\tif (opts->flags & PARSE_OPT_OPTARG)\n-\t\t\t\tpos += fprintf(stderr, \" [<n>]\");\n+\t\t\t\tpos += fprintf(stderr, \"[<n>]\");\n \t\t\telse\n \t\t\t\tpos += fprintf(stderr, \" <n>\");\n \t\t\tbreak;\n-- \n1.5.3.4\n"}]}