diff.c: prepare to use parse_options() for parsing
This is a preparation step to start using parse_options() to parse diff/revision options instead of what we have now. There are a couple of good things from using parse_options(): - better help usage - easier to add new options - better completion support - help usage generation - better integration with main command option parser. We can just concat the main command's option array and diffopt's together and parse all in one go. - detect colidding options (e.g. --reverse is used by revision code, so diff code can't use it as long name for -R) - consistent syntax, e.g. option that takes mandatory argument will now accept both "--option=value" and "--option value". The plan is migrate all diff/rev options to parse_options(). Then we could get rid of diff_opt_parse() and expose parseopts[] directly to the caller. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
2b393ef357
commit
4a28847839
2
diff.h
2
diff.h
@ -15,6 +15,7 @@ struct diff_filespec;
|
||||
struct diff_options;
|
||||
struct diff_queue_struct;
|
||||
struct oid_array;
|
||||
struct option;
|
||||
struct repository;
|
||||
struct rev_info;
|
||||
struct strbuf;
|
||||
@ -229,6 +230,7 @@ struct diff_options {
|
||||
unsigned color_moved_ws_handling;
|
||||
|
||||
struct repository *repo;
|
||||
struct option *parseopts;
|
||||
};
|
||||
|
||||
void diff_emit_submodule_del(struct diff_options *o, const char *line);
|
||||
|
||||
Reference in New Issue
Block a user