[master] 939585cf2 Inform about the default working directory in usage information

Nils Goroll nils.goroll at uplex.de
Mon Mar 6 14:54:06 UTC 2023


commit 939585cf2079fc6e59551c257c8ed2572b7c707c
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Thu Mar 2 12:17:14 2023 +0100

    Inform about the default working directory in usage information
    
    I noticed that users, apparently, have no way of finding out what
    their distribution configured?

diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index 2d77b7d63..698a6bbe6 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -82,6 +82,8 @@ static const char opt_spec[] = "?a:b:CdE:f:Fh:i:I:j:l:M:n:P:p:r:S:s:T:t:VW:x:";
 static void
 usage(void)
 {
+	char buf[1024];
+
 #define FMT "  %-28s # %s\n"
 
 	printf( "Usage: varnishd [options]\n");
@@ -102,7 +104,8 @@ usage(void)
 	printf(FMT, "", "  default: \":80\"");
 	printf(FMT, "-f vclfile", "VCL program");
 	printf(FMT, "", "Can be specified multiple times.");
-	printf(FMT, "-n dir", "Working directory");
+	bprintf(buf, "Working directory (default: %s)", VIN_n_Arg(NULL));
+	printf(FMT, "-n dir", buf);
 
 	printf("\n-b can be used only once, and not together with -f\n");
 


More information about the varnish-commit mailing list