summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Baudis <pasky@suse.cz>2005-10-25 15:26:25 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-10-26 05:51:18 (GMT)
commitf6ab5bb265ac821d9aab3755059eeadb615f512b (patch)
tree88f06ea6a1e904fdec9cc5b327d8d007782a8e52
parentd43367af55d8f67508000291b22e96c0a6b072dd (diff)
downloadgit-f6ab5bb265ac821d9aab3755059eeadb615f512b.zip
git-f6ab5bb265ac821d9aab3755059eeadb615f512b.tar.gz
git-f6ab5bb265ac821d9aab3755059eeadb615f512b.tar.bz2
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>
-rw-r--r--update-index.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/update-index.c b/update-index.c
index a84836b..661b86a 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] [--] <file>...";
+
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);