cmd/v: handle wrong type of flags

pull/3942/head
Delyan Angelov 2020-03-07 15:15:23 +02:00 committed by GitHub
parent 5827ff0a01
commit 88c1ff91ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -72,6 +72,9 @@ pub fn (p mut Instance) int() ?int {
val := p.string() or {
return error(err)
}
if !val[0].is_digit() {
return error('an integer number was expected, but "$val" was found instead.')
}
return val.int()
}