6 static const char diff_cache_usage
[] =
7 "git-diff-index [-m] [--cached] "
8 "[<common diff options>] <tree-ish> [<path>...]"
9 COMMON_DIFF_OPTIONS_HELP
;
11 int main(int argc
, const char **argv
)
17 git_config(git_diff_config
);
21 argc
= setup_revisions(argc
, argv
, &rev
, NULL
);
22 for (i
= 1; i
< argc
; i
++) {
23 const char *arg
= argv
[i
];
25 if (!strcmp(arg
, "--cached"))
28 usage(diff_cache_usage
);
31 * Make sure there is one revision (i.e. pending object),
32 * and there is no revision filtering parameters.
34 if (!rev
.pending_objects
|| rev
.pending_objects
->next
||
35 rev
.max_count
!= -1 || rev
.min_age
!= -1 || rev
.max_age
!= -1)
36 usage(diff_cache_usage
);
37 return run_diff_index(&rev
, cached
);