From 51a9949eda7421a2dd9cb45b2110d6571ba09bbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Thu, 7 May 2009 21:45:42 +0200 Subject: 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 Signed-off-by: Junio C Hamano --- test-parse-options.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test-parse-options.c') diff --git a/test-parse-options.c b/test-parse-options.c index d46eac21b1..e0669dcb41 100644 --- a/test-parse-options.c +++ b/test-parse-options.c @@ -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), -- cgit v1.2.3