From 88c1ff91acb5ec0831fbe42fcbc62a7abc26e957 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 7 Mar 2020 15:15:23 +0200 Subject: [PATCH] cmd/v: handle wrong type of flags --- cmd/v/internal/flag/flag.v | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/v/internal/flag/flag.v b/cmd/v/internal/flag/flag.v index 13864f635a..f2a36d9fc9 100644 --- a/cmd/v/internal/flag/flag.v +++ b/cmd/v/internal/flag/flag.v @@ -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() }