set stateLock to true when building meta flagSet

Any commands that use `stateLock` should have a flag to set that
value, but set a failsafe to true just in case.
This commit is contained in:
James Bardin 2017-03-30 13:54:27 -04:00
parent 54aa466b74
commit aad143b6d1
1 changed files with 4 additions and 0 deletions

View File

@ -264,6 +264,10 @@ func (m *Meta) flagSet(n string) *flag.FlagSet {
// Set the default Usage to empty
f.Usage = func() {}
// command that bypass locking will supply their own flag on this var, but
// set the initial meta value to true as a failsafe.
m.stateLock = true
return f
}