From f5c4671bfbad96bf346bd7e9a21fc4317b4959df Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Sat, 3 Dec 2022 17:00:20 +0530 Subject: Adds most of the tools --- .../testdata/simplest_flag_program.dashdash.help.out | 1 + .../testdata/simplest_flag_program.dashdash.version.out | 1 + .../v/vlib/flag/testdata/simplest_flag_program.help.out | 7 +++++++ .../v/vlib/flag/testdata/simplest_flag_program.out | 1 + v_windows/v/vlib/flag/testdata/simplest_flag_program.v | 14 ++++++++++++++ .../flag/testdata/simplest_flag_program.version.out | 1 + v_windows/v/vlib/flag/testdata/usage_example.help.out | 13 +++++++++++++ v_windows/v/vlib/flag/testdata/usage_example.out | 1 + v_windows/v/vlib/flag/testdata/usage_example.v | 17 +++++++++++++++++ .../v/vlib/flag/testdata/usage_example.version.out | 1 + 10 files changed, 57 insertions(+) create mode 100644 v_windows/v/vlib/flag/testdata/simplest_flag_program.dashdash.help.out create mode 100644 v_windows/v/vlib/flag/testdata/simplest_flag_program.dashdash.version.out create mode 100644 v_windows/v/vlib/flag/testdata/simplest_flag_program.help.out create mode 100644 v_windows/v/vlib/flag/testdata/simplest_flag_program.out create mode 100644 v_windows/v/vlib/flag/testdata/simplest_flag_program.v create mode 100644 v_windows/v/vlib/flag/testdata/simplest_flag_program.version.out create mode 100644 v_windows/v/vlib/flag/testdata/usage_example.help.out create mode 100644 v_windows/v/vlib/flag/testdata/usage_example.out create mode 100644 v_windows/v/vlib/flag/testdata/usage_example.v create mode 100644 v_windows/v/vlib/flag/testdata/usage_example.version.out (limited to 'v_windows/v/vlib/flag/testdata') 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 -- cgit v1.2.3