diff options
author | Matthieu Moy <Matthieu.Moy@imag.fr> | 2010-08-05 10:22:52 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-08-06 09:14:22 -0700 |
commit | dea007fb4c8170ea007b577698c7b44df6c318b9 (patch) | |
tree | 387a6302089953a7c07c9396cdbd91a36b031c7a /diff.h | |
parent | 64fdc08dac6694d1e754580e7acb82dfa4988bb9 (diff) | |
download | git-dea007fb4c8170ea007b577698c7b44df6c318b9.tar.gz |
diff: parse separate options like -S foo
Change the option parsing logic in revision.c to accept separate forms
like `-S foo' in addition to `-Sfoo'. The rest of git already accepted
this form, but revision.c still used its own option parsing.
Short options affected are -S<string>, -l<num> and -O<orderfile>, for
which an empty string wouldn't make sense, hence -<option> <arg> isn't
ambiguous.
This patch does not handle --stat-name-width and --stat-width, which are
special-cases where diff_long_opt do not apply. They are handled in a
separate patch to ease review.
Original patch by Matthieu Moy, plus refactoring by Jonathan Nieder.
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.h')
-rw-r--r-- | diff.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -214,6 +214,13 @@ extern void diff_unmerge(struct diff_options *, #define DIFF_SETUP_USE_CACHE 2 #define DIFF_SETUP_USE_SIZE_CACHE 4 +/* + * Poor man's alternative to parse-option, to allow both sticked form + * (--option=value) and separate form (--option value). + */ +extern int parse_long_opt(const char *opt, const char **argv, + const char **optarg); + extern int git_diff_basic_config(const char *var, const char *value, void *cb); extern int git_diff_ui_config(const char *var, const char *value, void *cb); extern int diff_use_color_default; |