[PATCH] Trivial fix: Display a more friendly message with git-shell.
- From
Thiago Farina <tfransosi@gmail.com>
- Date
- Sep 20, 2009, 17:11 UTC
- Message-ID
- <1253466672-21051-1-git-send-email-tfransosi@gmail.com>
Instead of simply die without give a helpful message, displays the usage string that shows to the user how it can be used.
Signed-off-by: Thiago Farina <tfransosi@gmail.com> --- shell.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/shell.c b/shell.c index e4864e0..aa7f47e 100644 --- a/shell.c +++ b/shell.c @@ -3,6 +3,8 @@ #include "exec_cmd.h" #include "strbuf.h" +static const char shell_usage[] = "git shell -c <command> <argument>"; + static int do_generic_cmd(const char *me, char *arg) { const char *my_argv[4]; @@ -74,7 +76,7 @@ int main(int argc, char **argv) * where "cmd" is a very limited subset of git commands. */ else if (argc != 3 || strcmp(argv[1], "-c")) - die("What do you think I am? A shell?"); + usage(shell_usage); prog = argv[2]; if (!strncmp(prog, "git", 3) && isspace(prog[3]))
-- 1.6.5.rc1.37.gf5c31.dirty