summaryrefslogtreecommitdiff
path: root/test-parse-options.c
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2009-05-07 21:45:42 +0200
committerJunio C Hamano <gitster@pobox.com>2009-05-09 00:29:50 -0700
commit51a9949eda7421a2dd9cb45b2110d6571ba09bbd (patch)
tree319237eb500050e73ddd9b6e5dee585a41dc4b69 /test-parse-options.c
parente0319ff5ed2b7927302389181449dcd029a26622 (diff)
downloadgit-51a9949eda7421a2dd9cb45b2110d6571ba09bbd.tar.gz
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>
Diffstat (limited to 'test-parse-options.c')
-rw-r--r--test-parse-options.c2
1 files changed, 2 insertions, 0 deletions
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),