Skip to content

Commit

Permalink
extra validation for input sample size
Browse files Browse the repository at this point in the history
  • Loading branch information
lsh-0 committed Oct 9, 2023
1 parent 295b7c8 commit 71c38be
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ func main() {
if len(args) == 3 {
sample_size, err = strconv.Atoi(args[2])
die(err != nil, "second argument is not an integer. use -1 for 'all' articles (default).")
die(sample_size <= 0 && sample_size != -1, "second argument must be -1 or a positive integer.")
}

if path_is_dir(input_path) {
Expand Down

0 comments on commit 71c38be

Please sign in to comment.