Code

Improve error reporting for unknown options
authorJonas Fonseca <fonseca@diku.dk>
Tue, 6 Jun 2006 11:35:25 +0000 (13:35 +0200)
committerJonas Fonseca <fonseca@antimatter.localdomain>
Tue, 6 Jun 2006 11:35:25 +0000 (13:35 +0200)
It will now also show usage help.

tig.c

diff --git a/tig.c b/tig.c
index 1f36682b28fde0bcc859b07f9741156170704d4e..b827a9292563ccbf1f1cc07a21291834e82e50ed 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -418,7 +418,7 @@ parse_options(int argc, char *argv[])
                if (opt[0] && opt[0] != '-')
                        break;
 
-               die("unknown command '%s'", opt);
+               die("unknown option '%s'\n\n%s", opt, usage);
        }
 
        if (!isatty(STDIN_FILENO)) {