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

cli: allow flag to be set multi time (#8256)

This commit is contained in:
Emeric MARTINEAU
2021-01-22 18:03:02 +01:00
committed by GitHub
parent f2c6735d92
commit 081e3c46b4
5 changed files with 286 additions and 28 deletions

View File

@ -79,6 +79,18 @@ fn test_if_flag_gets_set_with_abbrev() {
abbrev: 'f'
})
cmd.parse(['command', '-f', 'value'])
}
fn test_if_flag_gets_set_with_long_arg() {
mut cmd := cli.Command{
name: 'command'
execute: flag_should_be_set
}
cmd.add_flag(cli.Flag{
flag: .string
name: 'flag'
abbrev: 'f'
})
cmd.parse(['command', '--flag', 'value'])
}