Initial project import
This commit is contained in:
commit
23f2d29e32
11957 files changed
+1754577
No files matched your search
@@ -0,0 +1 @@
|
||||
[vlib/flag/testdata/simplest_flag_program.v:13] rest_of_args: ['--help']
|
||||
@@ -0,0 +1 @@
|
||||
[vlib/flag/testdata/simplest_flag_program.v:13] rest_of_args: ['--version']
|
||||
@@ -0,0 +1,7 @@
|
||||
abc 0.0.1
|
||||
-----------------------------------------------
|
||||
Usage: abc [options] [ARGS]
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
--version output version information and exit
|
||||
@@ -0,0 +1 @@
|
||||
[vlib/flag/testdata/simplest_flag_program.v:13] rest_of_args: []
|
||||
@@ -0,0 +1,14 @@
|
||||
import os
|
||||
import flag
|
||||
|
||||
fn main() {
|
||||
mut fp := flag.new_flag_parser(os.args)
|
||||
fp.application('abc')
|
||||
fp.version('0.0.1')
|
||||
fp.skip_executable()
|
||||
rest_of_args := fp.finalize() or {
|
||||
eprintln(err)
|
||||
exit(1)
|
||||
}
|
||||
dump(rest_of_args)
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
abc 0.0.1
|
||||
@@ -0,0 +1,13 @@
|
||||
xyz 0.0.2
|
||||
-----------------------------------------------
|
||||
Usage: xyz [NUMBER]...
|
||||
or: xyz OPTION
|
||||
|
||||
Description: description line 1
|
||||
description line 2
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
--version output version information and exit
|
||||
footer 1
|
||||
footer 2
|
||||
@@ -0,0 +1 @@
|
||||
[vlib/flag/testdata/usage_example.v:16] rest_of_args: ['abc', 'def']
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
import os
|
||||
import flag
|
||||
|
||||
fn main() {
|
||||
mut fp := flag.new_flag_parser(os.args)
|
||||
fp.skip_executable()
|
||||
fp.application('xyz')
|
||||
fp.version('0.0.2')
|
||||
fp.usage_example('[NUMBER]...')
|
||||
fp.usage_example('OPTION')
|
||||
fp.description('description line 1')
|
||||
fp.description('description line 2')
|
||||
fp.footer('footer 1')
|
||||
fp.footer('footer 2')
|
||||
rest_of_args := fp.remaining_parameters()
|
||||
dump(rest_of_args)
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
xyz 0.0.2
|
||||
Reference in new issue
Block a user