1
0
mirror of https://github.com/git/git.git synced 2024-09-28 07:40:44 +02:00

parse-opt: add PARSE_OPT_KEEP_ARGV0 parser option.

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>
This commit is contained in:
Pierre Habouzit 2008-06-24 00:31:31 +02:00 committed by Junio C Hamano
parent 26141b5b60
commit a32a4eaa36
2 changed files with 2 additions and 0 deletions

View File

@ -248,6 +248,7 @@ void parse_options_start(struct parse_opt_ctx_t *ctx,
ctx->argc = argc - 1;
ctx->argv = argv + 1;
ctx->out = argv;
ctx->cpidx = ((flags & PARSE_OPT_KEEP_ARGV0) != 0);
ctx->flags = flags;
}

View File

@ -20,6 +20,7 @@ enum parse_opt_type {
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 {