提交 f6ab5bb2 编写于 作者: P Petr Baudis 提交者: Junio C Hamano

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: NPetr Baudis <pasky@suse.cz>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 d43367af
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册