Skip to content

Commit 2f88543

Browse files
Rahixjo-m
authored andcommitted
add more clear error when no rect was set at all
When the rect was not set, show a more useful message that directs the user towards the parameters they need to use.
1 parent 33e649b commit 2f88543

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmd/trainbot/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ func parseCheckArgs() config {
9898
}
9999

100100
r := c.getRect()
101+
if r.Size().X == 0 && r.Size().Y == 0 {
102+
p.Fail("no rect set (use --rect-.. parameters to set crop region)")
103+
}
101104
if r.Size().X < rectSizeMin || r.Size().Y < rectSizeMin {
102105
p.Fail(fmt.Sprintf("rect is too small (minimum width and height is %d px)", rectSizeMin))
103106
}

0 commit comments

Comments
 (0)