git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Trivial fix: Display a more friendly message with git-shell.
@ 2009-09-20 17:11 Thiago Farina
  2009-09-21  4:21 ` Tay Ray Chuan
  2009-09-21  6:17 ` Johannes Sixt
  0 siblings, 2 replies; 8+ messages in thread
From: Thiago Farina @ 2009-09-20 17:11 UTC (permalink / raw)
  To: git; +Cc: Thiago Farina

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-09-22  8:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-20 17:11 [PATCH] Trivial fix: Display a more friendly message with git-shell Thiago Farina
2009-09-21  4:21 ` Tay Ray Chuan
2009-09-21  6:17 ` Johannes Sixt
2009-09-21  6:45   ` Matthieu Moy
2009-09-21 20:45     ` Thiago Farina
2009-09-22  7:28       ` Matthieu Moy
2009-09-22  8:15         ` Heiko Voigt
2009-09-22  8:17         ` Jakub Narebski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).