]> err.no Git - varnish/commitdiff
Cleaned up some usage statements
authorpetter <petter@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 11 Aug 2008 08:08:50 +0000 (08:08 +0000)
committerpetter <petter@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 11 Aug 2008 08:08:50 +0000 (08:08 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3074 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishncsa/varnishncsa.c
varnish-cache/bin/varnishtest/vtc.c

index efaf61bccc18a1741ec099d93bf24d2ab83d4644..3c133aa068df3c9417a49d8f0e14b3162926a049 100644 (file)
@@ -503,7 +503,7 @@ static void
 usage(void)
 {
 
-       fprintf(stderr, "usage: varnishncsa %s [-aDV] [-n varnish_name] [-P file] [-w file]\n", VSL_ARGS);
+       fprintf(stderr, "usage: varnishncsa %s [-aDV] [-n varnish_name] [-P file] [-w file]\n", VSL_USAGE);
        exit(1);
 }
 
index 89333d2131b2baea9b9a466e04edc6b4c2a7d881..fc263ce1f69350190fca31d03e20b528137261a9 100644 (file)
@@ -300,6 +300,17 @@ exec_file(const char *fn)
        printf("#    TEST %s completed\n", fn);
 }
 
+/**********************************************************************
+ * Print usage
+ */
+
+static void
+usage(void)
+{
+       fprintf(stderr, "usage: varnishtest [-qv] file ...\n");
+       exit(1);
+}
+
 /**********************************************************************
  * Main 
  */
@@ -322,13 +333,16 @@ main(int argc, char * const *argv)
                case 'v':
                        vtc_verbosity++;
                        break;
-               case '?':
                default:
-                       errx(1, "Usage");
+                       usage();
                }
        }
        argc -= optind;
        argv += optind;
+
+       if(argc == 0) 
+               usage();
+
        init_sema();
        for (ch = 0; ch < argc; ch++)
                exec_file(argv[ch]);