summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d1fff6f)
raw | patch | inline | side by side (parent: d1fff6f)
author | Stephen Boyd <bebarino@gmail.com> | |
Sun, 7 Jun 2009 23:39:15 +0000 (16:39 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 9 Jun 2009 07:15:57 +0000 (00:15 -0700) |
5734365 (show-branch: migrate to parse-options API 2009-05-21)
incorrectly set the --more option's flags to be
PARSE_OPT_LASTARG_DEFAULT and PARSE_OPT_OPTARG. These two flags
shouldn't be used together. An option taking a default should just set
the default value desired and parse options will take care of the rest.
Update the header comment to better convey this information.
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Acked-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
incorrectly set the --more option's flags to be
PARSE_OPT_LASTARG_DEFAULT and PARSE_OPT_OPTARG. These two flags
shouldn't be used together. An option taking a default should just set
the default value desired and parse options will take care of the rest.
Update the header comment to better convey this information.
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Acked-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-show-branch.c | patch | blob | history | |
parse-options.h | patch | blob | history |
diff --git a/builtin-show-branch.c b/builtin-show-branch.c
index 94338119569b6af85c9d121daa2134818f7d321e..01bea3b583b53f4930a1ab17d64b1b714f58099c 100644 (file)
--- a/builtin-show-branch.c
+++ b/builtin-show-branch.c
"color '*!+-' corresponding to the branch"),
{ OPTION_INTEGER, 0, "more", &extra, "n",
"show <n> more commits after the common ancestor",
- PARSE_OPT_OPTARG | PARSE_OPT_LASTARG_DEFAULT,
- NULL, (intptr_t)1 },
+ PARSE_OPT_OPTARG, NULL, (intptr_t)1 },
OPT_SET_INT(0, "list", &extra, "synonym to more=-1", -1),
OPT_BOOLEAN(0, "no-name", &no_name, "suppress naming strings"),
OPT_BOOLEAN(0, "current", &with_current_branch,
diff --git a/parse-options.h b/parse-options.h
index b374ade95c382afd742a32c80338e32cc565cab2..5653dbab87a7d27b10e1513c14ec6d0ec3464325 100644 (file)
--- a/parse-options.h
+++ b/parse-options.h
* PARSE_OPT_NONEG: says that this option cannot be negated
* PARSE_OPT_HIDDEN: this option is skipped in the default usage, and
* shown only in the full usage.
- * PARSE_OPT_LASTARG_DEFAULT: if no argument is given, the default value
- * is used.
+ * PARSE_OPT_LASTARG_DEFAULT: says that this option will take the default
+ * value if no argument is given when the option
+ * is last on the command line. If the option is
+ * not last it will require an argument.
+ * Should not be used with PARSE_OPT_OPTARG.
* PARSE_OPT_NODASH: this option doesn't start with a dash.
* PARSE_OPT_LITERAL_ARGHELP: says that argh shouldn't be enclosed in brackets
* (i.e. '<argh>') in the help message.