cli: make compile
parent
1318c27699
commit
e05f103c41
|
@ -7,8 +7,6 @@ import v.pref
|
||||||
const (
|
const (
|
||||||
skip_test_files = [
|
skip_test_files = [
|
||||||
'vlib/arrays/arrays_test.v',
|
'vlib/arrays/arrays_test.v',
|
||||||
'vlib/cli/command_test.v',
|
|
||||||
'vlib/cli/flag_test.v',
|
|
||||||
'vlib/crypto/aes/aes_test.v',
|
'vlib/crypto/aes/aes_test.v',
|
||||||
'vlib/crypto/rand/rand_test.v', // macOS only
|
'vlib/crypto/rand/rand_test.v', // macOS only
|
||||||
'vlib/crypto/rc4/rc4_test.v',
|
'vlib/crypto/rc4/rc4_test.v',
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
module cli
|
module cli
|
||||||
|
|
||||||
|
type CallbackFn fn(cmd Command)
|
||||||
|
|
||||||
pub struct Command {
|
pub struct Command {
|
||||||
pub mut:
|
pub mut:
|
||||||
name string
|
name string
|
||||||
description string
|
description string
|
||||||
version string
|
version string
|
||||||
pre_execute fn(cmd Command)
|
pre_execute CallbackFn
|
||||||
execute fn(cmd Command)
|
execute CallbackFn
|
||||||
post_execute fn(cmd Command)
|
post_execute CallbackFn
|
||||||
|
|
||||||
disable_help bool
|
disable_help bool
|
||||||
disable_version bool
|
disable_version bool
|
||||||
|
|
|
@ -49,8 +49,8 @@ fn test_if_float_flag_parses() {
|
||||||
}
|
}
|
||||||
|
|
||||||
flag.parse(['--flag', '3.14159']) or { panic(err) }
|
flag.parse(['--flag', '3.14159']) or { panic(err) }
|
||||||
assert flag.value.f32() == 3.14159
|
assert flag.value.f64() == 3.14159
|
||||||
|
|
||||||
flag.parse(['--flag=3.14159']) or { panic(err) }
|
flag.parse(['--flag=3.14159']) or { panic(err) }
|
||||||
assert flag.value.f32() == 3.14159
|
assert flag.value.f64() == 3.14159
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue