summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 26141b5)
raw | patch | inline | side by side (parent: 26141b5)
author | Pierre Habouzit <madcoder@debian.org> | |
Mon, 23 Jun 2008 22:31:31 +0000 (00:31 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 30 Jun 2008 21:51:13 +0000 (14:51 -0700) |
This way, argv[0] isn't clobbered when parse-options filters argv[].
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
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 0d3818ab4884e1df51d5e082df2a1e80d2582cdd..469831d21b99e2ea6d5d0be51555d853d68a7682 100644 (file)
--- a/parse-options.c
+++ b/parse-options.c
ctx->argc = argc - 1;
ctx->argv = argv + 1;
ctx->out = argv;
+ ctx->cpidx = ((flags & PARSE_OPT_KEEP_ARGV0) != 0);
ctx->flags = flags;
}
diff --git a/parse-options.h b/parse-options.h
index aeed627e9757df03df94a2c93bbd8112f4bb9a2c..c5f0b4b4dabb5a40027c0cc588549904e0efcc6f 100644 (file)
--- a/parse-options.h
+++ b/parse-options.h
enum parse_opt_flags {
PARSE_OPT_KEEP_DASHDASH = 1,
PARSE_OPT_STOP_AT_NON_OPTION = 2,
+ PARSE_OPT_KEEP_ARGV0 = 4,
};
enum parse_opt_option_flags {