From 3fd547f2e560ca13bd90c9a53802ad33c50e942f Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Wed, 8 Apr 2020 19:49:32 +0300 Subject: [PATCH] flag: fix compilation of programs using flag module --- vlib/flag/flag.v | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vlib/flag/flag.v b/vlib/flag/flag.v index 43b2af92c2..18e2dbf5cd 100644 --- a/vlib/flag/flag.v +++ b/vlib/flag/flag.v @@ -447,12 +447,13 @@ pub fn (fs FlagParser) usage() string { } } option_names := ' ' + onames.join(', ') - space := if option_names.len > space.len-2 { - '\n${space}' + xspace := '' + if option_names.len > space.len-2 { + xspace = '\n${space}' } else { - space[option_names.len..] + xspace = space[option_names.len..] } - use += '${option_names}${space}${f.usage}\n' + use += '${option_names}${xspace}${f.usage}\n' } }