From 720c5a33b6a49cf328fdd7611f49153cf8f60247 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 8 Apr 2020 14:51:57 +0300 Subject: Separate tests and examples into individual packages Also make cli module to be explicitly enabled via the config.cli configuration variable. --- examples/file/.gitignore | 1 - examples/file/README | 38 -------------------------------------- examples/file/buildfile | 11 ----------- examples/file/driver.cxx | 35 ----------------------------------- examples/file/options.cli | 7 ------- examples/file/test.ops | 7 ------- 6 files changed, 99 deletions(-) delete mode 100644 examples/file/.gitignore delete mode 100644 examples/file/README delete mode 100644 examples/file/buildfile delete mode 100644 examples/file/driver.cxx delete mode 100644 examples/file/options.cli delete mode 100644 examples/file/test.ops (limited to 'examples/file') diff --git a/examples/file/.gitignore b/examples/file/.gitignore deleted file mode 100644 index c6e608b..0000000 --- a/examples/file/.gitignore +++ /dev/null @@ -1 +0,0 @@ -options.?xx diff --git a/examples/file/README b/examples/file/README deleted file mode 100644 index 289fc64..0000000 --- a/examples/file/README +++ /dev/null @@ -1,38 +0,0 @@ -This example shows how to allow the users of your application to supply -options in files in addition to the command line. - -The example consists of the following files: - -options.cli - Command line interface description in the CLI language. - -options.hxx -options.ixx -options.cxx - Command line interface implementation in C++. These files are generated - by the CLI compiler from options.cli using the following command line: - - cli --generate-file-scanner hello.cli - - We use the --generate-file-scanner CLI compiler option to include the - argv_file_scanner scanner implementation which provides support for - reading options from files in addition to the command line. - -driver.cxx - Driver for the example. It first creates the argv_file_scanner object - and indicates that the values for the --options-file option should be - recognized as files containing additional options. It then passes this - scanner object to the option class which parses the command line. The - driver then prints the option values. - -test.ops - Sample options file. - -To run this example you can try the following command line: - -$ ./driver --verbose 2 --val 1 --options-file test.ops --val 4 - -The output will be: - -verbosity: 5 -values: 1 2 3 4 diff --git a/examples/file/buildfile b/examples/file/buildfile deleted file mode 100644 index eadfc66..0000000 --- a/examples/file/buildfile +++ /dev/null @@ -1,11 +0,0 @@ -# file : examples/file/buildfile -# license : MIT; see accompanying LICENSE file - -exe{driver}: {hxx cxx}{* -options} cli.cxx{options} doc{README} -exe{driver}: test.arguments = --options-file -exe{driver}: file{test.ops}: test.input = true # Added after test.arguments. - -cxx.poptions =+ "-I$out_base" - -cli.cxx{options}: cli{options} -cli.options = --generate-file-scanner diff --git a/examples/file/driver.cxx b/examples/file/driver.cxx deleted file mode 100644 index d187559..0000000 --- a/examples/file/driver.cxx +++ /dev/null @@ -1,35 +0,0 @@ -// file : examples/file/driver.cxx -// author : Boris Kolpackov -// license : MIT; see accompanying LICENSE file - -#include -#include -#include - -#include "options.hxx" - -using namespace std; - -int -main (int argc, char* argv[]) -{ - try - { - cli::argv_file_scanner s (argc, argv, "--options-file"); - options o (s); - - cout << "verbosity: " << o.verbose () << endl - << "values: "; - - copy (o.val ().begin (), - o.val ().end (), - ostream_iterator (cout, " ")); - - cerr << endl; - } - catch (const cli::exception& e) - { - cerr << e << endl; - return 1; - } -} diff --git a/examples/file/options.cli b/examples/file/options.cli deleted file mode 100644 index 3e6db5a..0000000 --- a/examples/file/options.cli +++ /dev/null @@ -1,7 +0,0 @@ -include ; - -class options -{ - int --verbose; - std::vector --val; -}; diff --git a/examples/file/test.ops b/examples/file/test.ops deleted file mode 100644 index 65fcf07..0000000 --- a/examples/file/test.ops +++ /dev/null @@ -1,7 +0,0 @@ -# Sample options file. Empty lines and lines starting with '#' are -# ignored. -# ---verbose 5 - ---val 2 ---val=3 -- cgit v1.1