parseopt: add PARSE_OPT_NODASH
Add support for options that don't start with a dash. Initially, they don't accept arguments and can only be short options, i.e. consist of a single character. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
e0319ff5ed
commit
51a9949eda
@ -54,6 +54,8 @@ int main(int argc, const char **argv)
|
||||
OPT_ARGUMENT("quux", "means --quux"),
|
||||
OPT_NUMBER_CALLBACK(&integer, "set integer to NUM",
|
||||
number_callback),
|
||||
{ OPTION_BOOLEAN, '+', NULL, &boolean, NULL, "same as -b",
|
||||
PARSE_OPT_NOARG | PARSE_OPT_NONEG | PARSE_OPT_NODASH },
|
||||
OPT_GROUP("Standard options"),
|
||||
OPT__ABBREV(&abbrev),
|
||||
OPT__VERBOSE(&verbose),
|
||||
|
Reference in New Issue
Block a user