mirror of https://github.com/docker/docs.git
More readable code
Signed-off-by: Jean-Laurent de Morlhon <jeanlaurent@morlhon.net>
This commit is contained in:
parent
b82f9a8509
commit
b6519d43e9
|
@ -356,14 +356,14 @@ func getDriverOpts(c CommandLine, mcnflags []mcnflag.Flag) drivers.DriverOptions
|
||||||
|
|
||||||
for _, name := range c.FlagNames() {
|
for _, name := range c.FlagNames() {
|
||||||
getter, ok := c.Generic(name).(flag.Getter)
|
getter, ok := c.Generic(name).(flag.Getter)
|
||||||
if !ok {
|
if ok {
|
||||||
|
driverOpts.Values[name] = getter.Get()
|
||||||
|
} else {
|
||||||
// TODO: This is pretty hacky. StringSlice is the only
|
// TODO: This is pretty hacky. StringSlice is the only
|
||||||
// type so far we have to worry about which is not a
|
// type so far we have to worry about which is not a
|
||||||
// Getter, though.
|
// Getter, though.
|
||||||
driverOpts.Values[name] = c.StringSlice(name)
|
driverOpts.Values[name] = c.StringSlice(name)
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
driverOpts.Values[name] = getter.Get()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return driverOpts
|
return driverOpts
|
||||||
|
|
Loading…
Reference in New Issue