1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cli: ensure that required flags are set (#8826)

This commit is contained in:
Miccah
2021-02-19 04:43:18 -06:00
committed by GitHub
parent 3f3bec45fa
commit a153ec5951
3 changed files with 25 additions and 8 deletions

View File

@@ -267,7 +267,7 @@ fn (cmd Command) check_version_flag() {
fn (cmd Command) check_required_flags() {
for flag in cmd.flags {
if flag.required && flag.value.len > 0 {
if flag.required && flag.value.len == 0 {
full_name := cmd.full_name()
println('Flag `$flag.name` is required by `$full_name`')
exit(1)