Skip to content

Commit

Permalink
fix: flag validation error in ipsw ent cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktop committed Oct 7, 2024
1 parent 58040a7 commit 477261b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd/ipsw/cmd/ent.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,12 @@ var entCmd = &cobra.Command{
// check flags
if len(dbFolder) == 0 && len(ipsws) == 0 && len(inputs) == 0 {
return fmt.Errorf("must supply either --db, --ipsw or --input")
} else if showUI && doDiff || len(ipsws) > 1 {
return fmt.Errorf("cannot use --ui with --diff OR multiple IPSWs")
} else if showUI && doDiff {
return fmt.Errorf("cannot use --ui and --diff together")
} else if showUI && (len(ipsws) != 1 && len(inputs) != 1) {
return fmt.Errorf("must supply only one --ipsw or --input with --ui")
} else if doDiff && (len(ipsws) != 2 && len(inputs) != 2) {
return fmt.Errorf("must supply two --ipsw or --input with --diff")
}
color.NoColor = viper.GetBool("no-color") || onlyFiles

Expand Down

0 comments on commit 477261b

Please sign in to comment.