summaryrefslogtreecommitdiff
path: root/cmd/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/main.go')
-rw-r--r--cmd/main.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/cmd/main.go b/cmd/main.go
index 498a8ae..348bdbc 100644
--- a/cmd/main.go
+++ b/cmd/main.go
@@ -338,6 +338,7 @@ func flagHelp(fs *flag.FlagSet) string {
buf := new(bytes.Buffer)
fs.SetOutput(buf)
+ buf.Write([]byte("(NOTE: use -- instead of - for flags)\n\n"))
fs.PrintDefaults()
return buf.String()
}
@@ -480,3 +481,16 @@ func CaddyVersion() string {
}
return ver
}
+
+// StringSlice is a flag.Value that enables repeated use of a string flag.
+type StringSlice []string
+
+func (ss StringSlice) String() string { return "[" + strings.Join(ss, ", ") + "]" }
+
+func (ss *StringSlice) Set(value string) error {
+ *ss = append(*ss, value)
+ return nil
+}
+
+// Interface guard
+var _ flag.Value = (*StringSlice)(nil)