Commit 4a28847
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>1 parent 2b393ef commit 4a28847
2 files changed
+29
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
4425 | 4426 | | |
4426 | 4427 | | |
4427 | 4428 | | |
| 4429 | + | |
| 4430 | + | |
4428 | 4431 | | |
4429 | 4432 | | |
4430 | 4433 | | |
| |||
4466 | 4469 | | |
4467 | 4470 | | |
4468 | 4471 | | |
| 4472 | + | |
| 4473 | + | |
4469 | 4474 | | |
4470 | 4475 | | |
4471 | 4476 | | |
| |||
4569 | 4574 | | |
4570 | 4575 | | |
4571 | 4576 | | |
| 4577 | + | |
| 4578 | + | |
4572 | 4579 | | |
4573 | 4580 | | |
4574 | 4581 | | |
| |||
4860 | 4867 | | |
4861 | 4868 | | |
4862 | 4869 | | |
| 4870 | + | |
| 4871 | + | |
| 4872 | + | |
| 4873 | + | |
| 4874 | + | |
| 4875 | + | |
| 4876 | + | |
| 4877 | + | |
| 4878 | + | |
| 4879 | + | |
4863 | 4880 | | |
4864 | 4881 | | |
4865 | 4882 | | |
| |||
4870 | 4887 | | |
4871 | 4888 | | |
4872 | 4889 | | |
| 4890 | + | |
| 4891 | + | |
| 4892 | + | |
| 4893 | + | |
| 4894 | + | |
| 4895 | + | |
| 4896 | + | |
| 4897 | + | |
| 4898 | + | |
| 4899 | + | |
4873 | 4900 | | |
4874 | 4901 | | |
4875 | 4902 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
| 233 | + | |
232 | 234 | | |
233 | 235 | | |
234 | 236 | | |
| |||
0 commit comments