diff options
author | Matt Holt <mholt@users.noreply.github.com> | 2022-08-01 13:36:22 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-01 13:36:22 -0600 |
commit | f783290f40febd3eef2a299911ad95bab4d2b414 (patch) | |
tree | 1baed0987f2ad5ed723dbda671f0eec13a414ca7 /cmd | |
parent | ebd6abcbd5f6b31b7b4cadca0a546d9f0eab9ad3 (diff) |
caddyhttp: Implement `caddy respond` command (#4870)
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/main.go | 14 |
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) |