make sure that flagVars is not a nil map
This commit is contained in:
parent
8d98ff46b5
commit
17d3671601
|
@ -120,6 +120,9 @@ func (m *Meta) FlagSet(n string, fs FlagSetFlags) *flag.FlagSet {
|
||||||
f.Var((*kvflag.Flag)(&m.flagVars), "var", "")
|
f.Var((*kvflag.Flag)(&m.flagVars), "var", "")
|
||||||
f.Var((*kvflag.FlagJSON)(&m.flagVars), "var-file", "")
|
f.Var((*kvflag.FlagJSON)(&m.flagVars), "var-file", "")
|
||||||
}
|
}
|
||||||
|
if len(m.flagVars) == 0 {
|
||||||
|
m.flagVars = make(map[string]string)
|
||||||
|
}
|
||||||
|
|
||||||
// Create an io.Writer that writes to our Ui properly for errors.
|
// Create an io.Writer that writes to our Ui properly for errors.
|
||||||
// This is kind of a hack, but it does the job. Basically: create
|
// This is kind of a hack, but it does the job. Basically: create
|
||||||
|
|
Loading…
Reference in New Issue