Flag version, bumped to v2

This commit is contained in:
Magnus Åhall 2024-04-23 20:21:08 +02:00
parent f523c6eaf0
commit 0bfcd7a8a9
2 changed files with 8 additions and 1 deletions

View File

@ -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)

View File

@ -9,7 +9,7 @@ import (
"slices"
)
const VERSION = "v1"
const VERSION = "v2"
const MAXLINE = 1048576
type Db struct {