Add usage string to git-update-index
This patch adds usage string to git-update-index, can be printed by the -h or --help parameter. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
Petr Baudis committed
Oct 25, 2005 at 17:26 UTC
f6ab5bb265ac821d9aab3755059eeadb615f512b
1 file changed
+5
update-index.c
+5
@@ -392,6 +392,9 @@ static void read_index_info(int line_termination)
392
}
393
}
394
395
+static const char update_index_usage[] =
396
+"git-update-index [-q] [--add] [--replace] [--remove] [--unmerged] [--refresh] [--cacheinfo] [--chmod=(+|-)x] [--info-only] [--force-remove] [--stdin] [--index-info] [--ignore-missing] [-z] [--version] [--] <file>...";
397
+
398
int main(int argc, const char **argv)
399
{
400
int i, newfd, entries, has_errors = 0, line_termination = '\n';
@@ -489,6 +492,8 @@ int main(int argc, const char **argv)
492
verbose = 1;
493
continue;
494
}
495
+ if (!strcmp(path, "-h") || !strcmp(path, "--help"))
496
+ usage(update_index_usage);
497
die("unknown option %s", path);
498
}
499
update_one(path, prefix, prefix_length);