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

cli: assign parent by default; add disable_flag

This commit is contained in:
Tim Basel
2020-05-28 13:32:43 +02:00
committed by GitHub
parent 977eb895e8
commit d688d356a7
4 changed files with 16 additions and 12 deletions

View File

@@ -8,7 +8,6 @@ fn main() {
name: 'cli',
description: 'An example of the cli library',
version: '1.0.0',
parent: 0
}
mut greet_cmd := cli.Command{
@@ -17,7 +16,6 @@ fn main() {
pre_execute: greet_pre_func,
execute: greet_func,
post_execute: greet_post_func,
parent: 0
}
greet_cmd.add_flag(cli.Flag{
flag: .string,
@@ -46,7 +44,10 @@ fn greet_func(cmd cli.Command) {
'english' { println('Hello World') }
'german' { println('Hallo Welt') }
'dutch' { println('Hallo Wereld') }
else { println('unsupported language') }
else {
println('unsupported language')
break
}
}
}
}