Skip to content

Commit

Permalink
Make exclusive test neater
Browse files Browse the repository at this point in the history
  • Loading branch information
quite committed Dec 18, 2023
1 parent 64f64a3 commit 888734d
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions cmd/age-plugin-tkey/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,8 @@ func run() int {
return 0
}

passed := 0
if generateFlag {
passed++
}
if convertFlag {
passed++
}
if agePluginFlag != "" {
passed++
}
if passed > 1 {
var boolInt = map[bool]int{false: 0, true: 1}
if (boolInt[generateFlag] + boolInt[convertFlag] + boolInt[agePluginFlag != ""]) > 1 {
le.Printf("Only one of -g, -y, and --age-plugin can be used\n")
flag.Usage()
return 2
Expand Down

0 comments on commit 888734d

Please sign in to comment.