2021-02-16 00:24:04 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
// Flags is a simple map of strings to boolean flag fields
|
|
|
|
type Flags map[string]bool
|
|
|
|
|
2021-02-20 17:09:04 +00:00
|
|
|
// GetFlag returns a boolean for the given flag
|
2021-02-16 00:24:04 +00:00
|
|
|
func (f Flags) GetFlag(s string) bool {
|
|
|
|
return f[s]
|
|
|
|
}
|
|
|
|
|
2021-02-20 17:09:04 +00:00
|
|
|
// SetFlag overwrites the existing boolean for the flag
|
2021-02-16 00:24:04 +00:00
|
|
|
func (f Flags) SetFlag(s string, b bool) {
|
|
|
|
f[s] = b
|
|
|
|
}
|