X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=update-index.c;h=661b86a979e7c75ea9b3ca9d030aebb44693ee04;hb=f6ab5bb265ac821d9aab3755059eeadb615f512b;hp=a84836be4a0cd32a61d4ae35c8ce3b0108ad5a34;hpb=d43367af55d8f67508000291b22e96c0a6b072dd;p=git.git diff --git a/update-index.c b/update-index.c index a84836be..661b86a9 100644 --- a/update-index.c +++ b/update-index.c @@ -392,6 +392,9 @@ static void read_index_info(int line_termination) } } +static const char update_index_usage[] = +"git-update-index [-q] [--add] [--replace] [--remove] [--unmerged] [--refresh] [--cacheinfo] [--chmod=(+|-)x] [--info-only] [--force-remove] [--stdin] [--index-info] [--ignore-missing] [-z] [--version] [--] ..."; + int main(int argc, const char **argv) { int i, newfd, entries, has_errors = 0, line_termination = '\n'; @@ -489,6 +492,8 @@ int main(int argc, const char **argv) verbose = 1; continue; } + if (!strcmp(path, "-h") || !strcmp(path, "--help")) + usage(update_index_usage); die("unknown option %s", path); } update_one(path, prefix, prefix_length);