Add syslog-address log-opt

Signed-off-by: Antonio Murdaca <me@runcom.ninja>
This commit is contained in:
Antonio Murdaca 2015-05-21 22:20:25 +02:00 committed by Vincent Demeester
parent e8e6124050
commit 51c5706326
1 changed files with 1 additions and 10 deletions

View File

@ -33,7 +33,7 @@ func MapVar(values map[string]string, names []string, usage string) {
} }
func LogOptsVar(values map[string]string, names []string, usage string) { func LogOptsVar(values map[string]string, names []string, usage string) {
flag.Var(newMapOpt(values, ValidateLogOpts), names, usage) flag.Var(newMapOpt(values, nil), names, usage)
} }
func HostListVar(values *[]string, names []string, usage string) { func HostListVar(values *[]string, names []string, usage string) {
@ -176,15 +176,6 @@ func newMapOpt(values map[string]string, validator ValidatorFctType) *MapOpts {
type ValidatorFctType func(val string) (string, error) type ValidatorFctType func(val string) (string, error)
type ValidatorFctListType func(val string) ([]string, error) type ValidatorFctListType func(val string) ([]string, error)
func ValidateLogOpts(val string) (string, error) {
allowedKeys := map[string]string{}
vals := strings.Split(val, "=")
if allowedKeys[vals[0]] != "" {
return val, nil
}
return "", fmt.Errorf("%s is not a valid log opt", vals[0])
}
func ValidateAttach(val string) (string, error) { func ValidateAttach(val string) (string, error) {
s := strings.ToLower(val) s := strings.ToLower(val)
for _, str := range []string{"stdin", "stdout", "stderr"} { for _, str := range []string{"stdin", "stdout", "stderr"} {