mirror of https://github.com/docker/cli.git
Add syslog-address log-opt
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
This commit is contained in:
parent
e8e6124050
commit
51c5706326
11
opts/opts.go
11
opts/opts.go
|
@ -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"} {
|
||||||
|
|
Loading…
Reference in New Issue