Skip to content

Commit

Permalink
cmd/jv: simplify output arg validation
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Aug 21, 2023
1 parent e0c304c commit 8ffba32
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cmd/jv/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,14 @@ func main() {
compiler.AssertContent = *assertContent

var validOutput bool
for _, out := range append(validOutputs, "") {
if *output == out {
validOutput = true
break
if *output == "" {
validOutput = true
} else {
for _, out := range validOutputs {
if *output == out {
validOutput = true
break
}
}
}
if !validOutput {
Expand Down

0 comments on commit 8ffba32

Please sign in to comment.