Compare commits
No commits in common. "77260743a06a0c23bf0a6d94687667e1365ecc7c" and "0bfcd7a8a9441e1a8c7e1d75fe3150624419728f" have entirely different histories.
77260743a0
...
0bfcd7a8a9
7
flag.go
7
flag.go
@ -20,14 +20,12 @@ func (i *arrayFlags) Set(value string) error {
|
||||
|
||||
var (
|
||||
flagVersion bool
|
||||
flagList bool
|
||||
flagIncludeAll bool
|
||||
flagExcludeAll bool
|
||||
flagExcept arrayFlags
|
||||
)
|
||||
|
||||
func init() {
|
||||
flag.BoolVar(&flagList, "list", false, "Only list database names.")
|
||||
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.")
|
||||
@ -39,11 +37,6 @@ func init() {
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
if flagList && (flagIncludeAll || flagExcludeAll || len(flagExcept) > 0) {
|
||||
fmt.Println("-list is not usable with any other flag.")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if flagIncludeAll && flagExcludeAll {
|
||||
fmt.Println("-include-all and -exclude-all are mutually exclusive")
|
||||
os.Exit(1)
|
||||
|
6
main.go
6
main.go
@ -9,7 +9,7 @@ import (
|
||||
"slices"
|
||||
)
|
||||
|
||||
const VERSION = "v3"
|
||||
const VERSION = "v2"
|
||||
const MAXLINE = 1048576
|
||||
|
||||
type Db struct {
|
||||
@ -75,11 +75,11 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
if !flagList && db.IsOpen() {
|
||||
if db.IsOpen() {
|
||||
db.Write(line)
|
||||
}
|
||||
|
||||
if !flagList && dbDone.MatchString(line) {
|
||||
if dbDone.MatchString(line) {
|
||||
db.Completed = true
|
||||
db.Close()
|
||||
prevDb = db
|
||||
|
Loading…
Reference in New Issue
Block a user