mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cmd/v: handle wrong type of flags
This commit is contained in:
parent
5827ff0a01
commit
88c1ff91ac
@ -72,6 +72,9 @@ pub fn (p mut Instance) int() ?int {
|
|||||||
val := p.string() or {
|
val := p.string() or {
|
||||||
return error(err)
|
return error(err)
|
||||||
}
|
}
|
||||||
|
if !val[0].is_digit() {
|
||||||
|
return error('an integer number was expected, but "$val" was found instead.')
|
||||||
|
}
|
||||||
return val.int()
|
return val.int()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user