mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cli: make compile
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
module cli
|
||||
|
||||
type CallbackFn fn(cmd Command)
|
||||
|
||||
pub struct Command {
|
||||
pub mut:
|
||||
name string
|
||||
description string
|
||||
version string
|
||||
pre_execute fn(cmd Command)
|
||||
execute fn(cmd Command)
|
||||
post_execute fn(cmd Command)
|
||||
pre_execute CallbackFn
|
||||
execute CallbackFn
|
||||
post_execute CallbackFn
|
||||
|
||||
disable_help bool
|
||||
disable_version bool
|
||||
|
@@ -49,8 +49,8 @@ fn test_if_float_flag_parses() {
|
||||
}
|
||||
|
||||
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) }
|
||||
assert flag.value.f32() == 3.14159
|
||||
assert flag.value.f64() == 3.14159
|
||||
}
|
||||
|
Reference in New Issue
Block a user