summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: be2fb16)
raw | patch | inline | side by side (parent: be2fb16)
author | Junio C Hamano <gitster@pobox.com> | |
Sat, 6 Mar 2010 20:34:40 +0000 (21:34 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 7 Mar 2010 07:58:33 +0000 (23:58 -0800) |
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
parse-options.c | patch | blob | history | |
parse-options.h | patch | blob | history |
diff --git a/parse-options.c b/parse-options.c
index c83035d013d3f50e9367f2b07d49cf17a1e22ff6..8546d8526f311e2a2703c258a4da3f02f8650df4 100644 (file)
--- a/parse-options.c
+++ b/parse-options.c
*target = unset ? 2 : 1;
return 0;
}
+
+int parse_options_concat(struct option *dst, size_t dst_size, struct option *src)
+{
+ int i, j;
+
+ for (i = 0; i < dst_size; i++)
+ if (dst[i].type == OPTION_END)
+ break;
+ for (j = 0; i < dst_size; i++, j++) {
+ dst[i] = src[j];
+ if (src[j].type == OPTION_END)
+ return 0;
+ }
+ return -1;
+}
diff --git a/parse-options.h b/parse-options.h
index 9429f7e36112b7b9cf52d4b3b68b007938396322..7581e931da13151473739036a89d9d19303eb18b 100644 (file)
--- a/parse-options.h
+++ b/parse-options.h
extern int parse_options_end(struct parse_opt_ctx_t *ctx);
+extern int parse_options_concat(struct option *dst, size_t, struct option *src);
/*----- some often used options -----*/
extern int parse_opt_abbrev_cb(const struct option *, const char *, int);