cli: make compile

pull/4447/head
Enzo Baldisserri 2020-04-16 14:50:04 +02:00 committed by GitHub
parent 1318c27699
commit e05f103c41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -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',

View File

@ -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

View File

@ -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
} }