path: root/parse-options.h
diff options
authorStephen Boyd <>2009-06-07 23:39:15 (GMT)
committerJunio C Hamano <>2009-06-09 07:15:57 (GMT)
commite169b974593c27ba7a0d7f63ec0ec40373cb64bb (patch)
tree6362500196263a0a0dc2b33315ac83dffdd94ca4 /parse-options.h
parentd1fff6fce0e065d1dbb1450146a6f6f79b349229 (diff)
show-branch: don't use LASTARG_DEFAULT with OPTARG
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 <> Acked-by: René Scharfe <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'parse-options.h')
1 files changed, 5 insertions, 2 deletions
diff --git a/parse-options.h b/parse-options.h
index b374ade..5653dba 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -71,8 +71,11 @@ typedef int parse_opt_cb(const struct option *, const char *arg, int unset);
* 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.