diff options
author | Paul Tan <pyokagan@gmail.com> | 2015-06-14 16:41:48 +0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-06-15 12:40:49 -0700 |
commit | 6b3ee18dc5c620d7cb4324e009339b5ca9ac488c (patch) | |
tree | f98ba0b5219f058d7f32514529568dec670c1934 /parse-options.h | |
parent | 7974889a053574e449b55ca543a486e38e74864f (diff) | |
download | git-6b3ee18dc5c620d7cb4324e009339b5ca9ac488c.tar.gz |
parse-options-cb: implement parse_opt_passthru()
Certain git commands, such as git-pull, are simply wrappers around other
git commands like git-fetch, git-merge and git-rebase. As such, these
wrapper commands will typically need to "pass through" command-line
options of the commands they wrap.
Implement the parse_opt_passthru() parse-options callback, which will
reconstruct the command-line option into an char* string, such that it
can be passed to another git command.
Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'parse-options.h')
-rw-r--r-- | parse-options.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/parse-options.h b/parse-options.h index c71e9da4f8..5b0f8860fd 100644 --- a/parse-options.h +++ b/parse-options.h @@ -224,6 +224,7 @@ extern int parse_opt_with_commit(const struct option *, const char *, int); extern int parse_opt_tertiary(const struct option *, const char *, int); extern int parse_opt_string_list(const struct option *, const char *, int); extern int parse_opt_noop_cb(const struct option *, const char *, int); +extern int parse_opt_passthru(const struct option *, const char *, int); #define OPT__VERBOSE(var, h) OPT_COUNTUP('v', "verbose", (var), (h)) #define OPT__QUIET(var, h) OPT_COUNTUP('q', "quiet", (var), (h)) @@ -242,5 +243,7 @@ extern int parse_opt_noop_cb(const struct option *, const char *, int); OPT_COLOR_FLAG(0, "color", (var), (h)) #define OPT_COLUMN(s, l, v, h) \ { OPTION_CALLBACK, (s), (l), (v), N_("style"), (h), PARSE_OPT_OPTARG, parseopt_column_callback } +#define OPT_PASSTHRU(s, l, v, a, h, f) \ + { OPTION_CALLBACK, (s), (l), (v), (a), (h), (f), parse_opt_passthru } #endif |