diff options
author | Indrajith K L | 2022-12-03 17:00:20 +0530 |
---|---|---|
committer | Indrajith K L | 2022-12-03 17:00:20 +0530 |
commit | f5c4671bfbad96bf346bd7e9a21fc4317b4959df (patch) | |
tree | 2764fc62da58f2ba8da7ed341643fc359873142f /v_windows/v/vlib/flag/testdata | |
download | cli-tools-windows-f5c4671bfbad96bf346bd7e9a21fc4317b4959df.tar.gz cli-tools-windows-f5c4671bfbad96bf346bd7e9a21fc4317b4959df.tar.bz2 cli-tools-windows-f5c4671bfbad96bf346bd7e9a21fc4317b4959df.zip |
Diffstat (limited to 'v_windows/v/vlib/flag/testdata')
10 files changed, 57 insertions, 0 deletions
diff --git a/v_windows/v/vlib/flag/testdata/simplest_flag_program.dashdash.help.out b/v_windows/v/vlib/flag/testdata/simplest_flag_program.dashdash.help.out new file mode 100644 index 0000000..2529e9f --- /dev/null +++ b/v_windows/v/vlib/flag/testdata/simplest_flag_program.dashdash.help.out @@ -0,0 +1 @@ +[vlib/flag/testdata/simplest_flag_program.v:13] rest_of_args: ['--help'] diff --git a/v_windows/v/vlib/flag/testdata/simplest_flag_program.dashdash.version.out b/v_windows/v/vlib/flag/testdata/simplest_flag_program.dashdash.version.out new file mode 100644 index 0000000..b0b4d65 --- /dev/null +++ b/v_windows/v/vlib/flag/testdata/simplest_flag_program.dashdash.version.out @@ -0,0 +1 @@ +[vlib/flag/testdata/simplest_flag_program.v:13] rest_of_args: ['--version'] diff --git a/v_windows/v/vlib/flag/testdata/simplest_flag_program.help.out b/v_windows/v/vlib/flag/testdata/simplest_flag_program.help.out new file mode 100644 index 0000000..9b5ab9e --- /dev/null +++ b/v_windows/v/vlib/flag/testdata/simplest_flag_program.help.out @@ -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 diff --git a/v_windows/v/vlib/flag/testdata/simplest_flag_program.out b/v_windows/v/vlib/flag/testdata/simplest_flag_program.out new file mode 100644 index 0000000..02b7cea --- /dev/null +++ b/v_windows/v/vlib/flag/testdata/simplest_flag_program.out @@ -0,0 +1 @@ +[vlib/flag/testdata/simplest_flag_program.v:13] rest_of_args: [] diff --git a/v_windows/v/vlib/flag/testdata/simplest_flag_program.v b/v_windows/v/vlib/flag/testdata/simplest_flag_program.v new file mode 100644 index 0000000..cee2ff7 --- /dev/null +++ b/v_windows/v/vlib/flag/testdata/simplest_flag_program.v @@ -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) +} diff --git a/v_windows/v/vlib/flag/testdata/simplest_flag_program.version.out b/v_windows/v/vlib/flag/testdata/simplest_flag_program.version.out new file mode 100644 index 0000000..de52cb0 --- /dev/null +++ b/v_windows/v/vlib/flag/testdata/simplest_flag_program.version.out @@ -0,0 +1 @@ +abc 0.0.1 diff --git a/v_windows/v/vlib/flag/testdata/usage_example.help.out b/v_windows/v/vlib/flag/testdata/usage_example.help.out new file mode 100644 index 0000000..b40047b --- /dev/null +++ b/v_windows/v/vlib/flag/testdata/usage_example.help.out @@ -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 diff --git a/v_windows/v/vlib/flag/testdata/usage_example.out b/v_windows/v/vlib/flag/testdata/usage_example.out new file mode 100644 index 0000000..b2fd000 --- /dev/null +++ b/v_windows/v/vlib/flag/testdata/usage_example.out @@ -0,0 +1 @@ +[vlib/flag/testdata/usage_example.v:16] rest_of_args: ['abc', 'def'] diff --git a/v_windows/v/vlib/flag/testdata/usage_example.v b/v_windows/v/vlib/flag/testdata/usage_example.v new file mode 100644 index 0000000..522b758 --- /dev/null +++ b/v_windows/v/vlib/flag/testdata/usage_example.v @@ -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) +} diff --git a/v_windows/v/vlib/flag/testdata/usage_example.version.out b/v_windows/v/vlib/flag/testdata/usage_example.version.out new file mode 100644 index 0000000..9196894 --- /dev/null +++ b/v_windows/v/vlib/flag/testdata/usage_example.version.out @@ -0,0 +1 @@ +xyz 0.0.2 |