[master] cd43465 Make varnishlog complain if regex and tag is passed but no -o

Tollef Fog Heen tfheen at varnish-cache.org
Thu Mar 31 13:19:27 CEST 2011


commit cd4346594e48acc97e9f4731f4d469bde6d16d82
Author: Tollef Fog Heen <tfheen at varnish-software.com>
Date:   Thu Mar 31 13:18:57 2011 +0200

    Make varnishlog complain if regex and tag is passed but no -o

diff --git a/bin/varnishlog/varnishlog.c b/bin/varnishlog/varnishlog.c
index f7075ac..0d78bf2 100644
--- a/bin/varnishlog/varnishlog.c
+++ b/bin/varnishlog/varnishlog.c
@@ -303,7 +303,7 @@ static void
 usage(void)
 {
 	fprintf(stderr, "usage: varnishlog "
-	    "%s [-aDoV] [-n varnish_name] [-P file] [-w file]\n", VSL_USAGE);
+	    "%s [-aDV] [-o [tag regex]] [-n varnish_name] [-P file] [-w file]\n", VSL_USAGE);
 	exit(1);
 }
 
@@ -361,6 +361,9 @@ main(int argc, char * const *argv)
 	if (o_flag && w_arg != NULL)
 		usage();
 
+	if ((argc - optind) > 0 && !o_flag)
+		usage();
+
 	if (VSL_Open(vd, 1))
 		exit(1);
 



More information about the varnish-commit mailing list