Code

Oops, check log, diff, and show before options
authorJonas Fonseca <fonseca@diku.dk>
Mon, 18 Sep 2006 15:33:28 +0000 (17:33 +0200)
committerJonas Fonseca <fonseca@antimatter.localdomain>
Mon, 18 Sep 2006 15:33:28 +0000 (17:33 +0200)
tig.c

diff --git a/tig.c b/tig.c
index 1f92114dc0710c9b2660deda4a7daa6601eaa460..471fa4dd6bd37f578e6c6f9c64a332d8904de2ae 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -451,6 +451,14 @@ parse_options(int argc, char *argv[])
        for (i = 1; i < argc; i++) {
                char *opt = argv[i];
 
+               if (!strcmp(opt, "log") ||
+                   !strcmp(opt, "diff") ||
+                   !strcmp(opt, "show")) {
+                       opt_request = opt[0] == 'l'
+                                   ? REQ_VIEW_LOG : REQ_VIEW_DIFF;
+                       break;
+               }
+
                if (opt[0] && opt[0] != '-')
                        break;
 
@@ -489,14 +497,6 @@ parse_options(int argc, char *argv[])
                        break;
                }
 
-               if (!strcmp(opt, "log") ||
-                   !strcmp(opt, "diff") ||
-                   !strcmp(opt, "show")) {
-                       opt_request = opt[0] == 'l'
-                                   ? REQ_VIEW_LOG : REQ_VIEW_DIFF;
-                       break;
-               }
-
                die("unknown option '%s'\n\n%s", opt, usage);
        }