Flag version, bumped to v2
This commit is contained in:
parent
f523c6eaf0
commit
0bfcd7a8a9
7
flag.go
7
flag.go
@ -19,17 +19,24 @@ func (i *arrayFlags) Set(value string) error {
|
||||
}
|
||||
|
||||
var (
|
||||
flagVersion bool
|
||||
flagIncludeAll bool
|
||||
flagExcludeAll bool
|
||||
flagExcept arrayFlags
|
||||
)
|
||||
|
||||
func init() {
|
||||
flag.BoolVar(&flagVersion, "version", false, "Prints version and exits.")
|
||||
flag.BoolVar(&flagIncludeAll, "include-all", false, "Split out all databases, with provided exceptions.")
|
||||
flag.BoolVar(&flagExcludeAll, "exclude-all", false, "Split out no databases, with provided exceptions.")
|
||||
flag.Var(&flagExcept, "except", "Exception to rule, can be used multiple times")
|
||||
flag.Parse()
|
||||
|
||||
if flagVersion {
|
||||
fmt.Println(VERSION)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
if flagIncludeAll && flagExcludeAll {
|
||||
fmt.Println("-include-all and -exclude-all are mutually exclusive")
|
||||
os.Exit(1)
|
||||
|
Loading…
Reference in New Issue
Block a user