submodule--helper: show usage for "-h"
Normal users shouldn't ever call submodule--helper, but it doesn't hurt to give them a normal usage message if they try "-h". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
May 30, 2017 at 01:16 UTC
f0994fa85dfcbd9854686d7b6de3b05b7952f41c
1 file changed
+2
-3
builtin/submodule--helper.c
+2
-3
@@ -1222,9 +1222,8 @@ static struct cmd_struct commands[] = {
1222
int cmd_submodule__helper(int argc, const char **argv, const char *prefix)
1223
{
1224
int i;
1225
- if (argc < 2)
1226
- die(_("submodule--helper subcommand must be "
1227
- "called with a subcommand"));
1225
+ if (argc < 2 || !strcmp(argv[1], "-h"))
1226
+ usage("git submodule--helper <command>");
1227
1228
for (i = 0; i < ARRAY_SIZE(commands); i++) {
1229
if (!strcmp(argv[1], commands[i].cmd)) {