Re: Re: [PATCH] Trivial fix: Display a more friendly message with git-shell.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 22, 2009 at 09:28:13AM +0200, Matthieu Moy wrote:
> Thiago Farina <tfransosi@xxxxxxxxx> writes:
> 
> > On Mon, Sep 21, 2009 at 3:45 AM, Matthieu Moy
> > <Matthieu.Moy@xxxxxxxxxxxxxxx> wrote:
> >> $ git-shell
> >> git-shell: Restricted login shell for GIT-only SSH access
> >> Usage: ...
> > I added this line to the output usage, but would be good to show the
> > commands that git-shell accept too?
> 
> Well, at some point, I think the user will have to read the man page.
> I find it better to have a non-agressive error message, but I'm not
> sure it's relevant to try to give the complete manual here.

Why not simply like this? I liked the old output as well. And sometimes its
just better to have commands behave like humans ;)

diff --git a/shell.c b/shell.c
index e4864e0..a0da191 100644
--- a/shell.c
+++ b/shell.c
@@ -74,7 +74,8 @@ 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?");
+               die("What do you think I am? A shell?\n\
+                    See: git help shell");
 
        prog = argv[2];
        if (!strncmp(prog, "git", 3) && isspace(prog[3]))

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]