summaryrefslogtreecommitdiff
path: root/builtin/remote-ext.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-05-30 05:15:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-30 05:45:04 (GMT)
commitbb246590a1b648ac23f6a22d1d9e119129ba2f03 (patch)
treed12121b7ec9360b530814c5d7397f2e78821fbae /builtin/remote-ext.c
parent619b6c1710f726866f62e34b01cc57c03b390299 (diff)
downloadgit-bb246590a1b648ac23f6a22d1d9e119129ba2f03.zip
git-bb246590a1b648ac23f6a22d1d9e119129ba2f03.tar.gz
git-bb246590a1b648ac23f6a22d1d9e119129ba2f03.tar.bz2
remote-{ext,fd}: print usage message on invalid arguments
We just say "Expected two arguments" when we get a different number of arguments, but we can be slightly friendlier. People shouldn't generally be running remote helpers themselves, but curious users might say "git remote-ext -h". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/remote-ext.c')
-rw-r--r--builtin/remote-ext.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/remote-ext.c b/builtin/remote-ext.c
index 11b48bf..bfb21ba 100644
--- a/builtin/remote-ext.c
+++ b/builtin/remote-ext.c
@@ -3,6 +3,9 @@
#include "run-command.h"
#include "pkt-line.h"
+static const char usage_msg[] =
+ "git remote-ext <remote> <url>";
+
/*
* URL syntax:
* 'command [arg1 [arg2 [...]]]' Invoke command with given arguments.
@@ -193,7 +196,7 @@ static int command_loop(const char *child)
int cmd_remote_ext(int argc, const char **argv, const char *prefix)
{
if (argc != 3)
- die("Expected two arguments");
+ usage(usage_msg);
return command_loop(argv[2]);
}