summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-04-08 14:51:57 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-04-27 11:38:53 +0300
commit720c5a33b6a49cf328fdd7611f49153cf8f60247 (patch)
tree9725f3d1f42ec90fde84520f49647edea013ce5e
parent3183f3bb927a90783ae0aeaf190a0919377aabe4 (diff)
Separate tests and examples into individual packages
Also make cli module to be explicitly enabled via the config.cli configuration variable.
-rw-r--r--.gitignore20
-rw-r--r--INSTALL92
-rw-r--r--build/bootstrap.build18
-rw-r--r--build/root.build37
-rw-r--r--buildfile30
-rw-r--r--cli-examples/.gitignore21
l---------cli-examples/LICENSE1
-rw-r--r--cli-examples/README (renamed from examples/README)2
-rw-r--r--cli-examples/build/.gitignore (renamed from examples/build/.gitignore)0
-rw-r--r--cli-examples/build/bootstrap.build (renamed from tests/build/bootstrap.build)5
-rw-r--r--cli-examples/build/root.build27
-rw-r--r--cli-examples/buildfile4
-rw-r--r--cli-examples/features/.gitignore (renamed from examples/features/.gitignore)0
-rw-r--r--cli-examples/features/README (renamed from examples/features/README)0
-rw-r--r--cli-examples/features/buildfile (renamed from examples/features/buildfile)2
-rw-r--r--cli-examples/features/driver.cxx (renamed from examples/features/driver.cxx)2
-rw-r--r--cli-examples/features/options.cli (renamed from examples/features/options.cli)0
-rw-r--r--cli-examples/file/.gitignore (renamed from examples/file/.gitignore)0
-rw-r--r--cli-examples/file/README (renamed from examples/file/README)0
-rw-r--r--cli-examples/file/buildfile (renamed from examples/file/buildfile)2
-rw-r--r--cli-examples/file/driver.cxx (renamed from examples/file/driver.cxx)2
-rw-r--r--cli-examples/file/options.cli (renamed from examples/file/options.cli)0
-rw-r--r--cli-examples/file/test.ops (renamed from examples/file/test.ops)0
-rw-r--r--cli-examples/hello/.gitignore (renamed from examples/hello/.gitignore)0
-rw-r--r--cli-examples/hello/README (renamed from examples/hello/README)0
-rw-r--r--cli-examples/hello/buildfile (renamed from examples/hello/buildfile)2
-rw-r--r--cli-examples/hello/driver.cxx (renamed from examples/hello/driver.cxx)2
-rw-r--r--cli-examples/hello/hello.cli (renamed from examples/hello/hello.cli)0
-rw-r--r--cli-examples/manifest15
-rw-r--r--cli-tests/.gitignore22
l---------cli-tests/LICENSE1
-rw-r--r--cli-tests/README8
-rw-r--r--cli-tests/build/.gitignore (renamed from tests/build/.gitignore)0
-rw-r--r--cli-tests/build/bootstrap.build (renamed from examples/build/bootstrap.build)5
-rw-r--r--cli-tests/build/root.build27
-rw-r--r--cli-tests/buildfile4
-rw-r--r--cli-tests/combined/buildfile (renamed from tests/combined/buildfile)2
-rw-r--r--cli-tests/combined/driver.cxx (renamed from tests/combined/driver.cxx)2
-rw-r--r--cli-tests/combined/test.cli (renamed from tests/combined/test.cli)2
-rw-r--r--cli-tests/combined/testscript (renamed from tests/combined/testscript)2
-rw-r--r--cli-tests/ctor/buildfile (renamed from tests/ctor/buildfile)2
-rw-r--r--cli-tests/ctor/driver.cxx (renamed from tests/ctor/driver.cxx)2
-rw-r--r--cli-tests/ctor/test.cli (renamed from tests/ctor/test.cli)2
-rw-r--r--cli-tests/erase/buildfile (renamed from tests/erase/buildfile)2
-rw-r--r--cli-tests/erase/driver.cxx (renamed from tests/erase/driver.cxx)2
-rw-r--r--cli-tests/erase/test.cli (renamed from tests/erase/test.cli)2
-rw-r--r--cli-tests/file/buildfile (renamed from tests/file/buildfile)2
-rw-r--r--cli-tests/file/driver.cxx (renamed from tests/file/driver.cxx)2
-rw-r--r--cli-tests/file/test.cli (renamed from tests/file/test.cli)2
-rw-r--r--cli-tests/file/testscript (renamed from tests/file/testscript)2
-rw-r--r--cli-tests/group/buildfile (renamed from tests/group/buildfile)2
-rw-r--r--cli-tests/group/driver.cxx (renamed from tests/group/driver.cxx)2
-rw-r--r--cli-tests/group/test.cli (renamed from tests/group/test.cli)2
-rw-r--r--cli-tests/group/testscript (renamed from tests/group/testscript)2
-rw-r--r--cli-tests/headings/buildfile6
-rw-r--r--cli-tests/headings/testscript (renamed from tests/headings/testscript)4
-rw-r--r--cli-tests/inheritance/buildfile (renamed from tests/inheritance/buildfile)2
-rw-r--r--cli-tests/inheritance/driver.cxx (renamed from tests/inheritance/driver.cxx)2
-rw-r--r--cli-tests/inheritance/test.cli (renamed from tests/inheritance/test.cli)2
-rw-r--r--cli-tests/inheritance/test.std (renamed from tests/inheritance/test.std)0
-rw-r--r--cli-tests/manifest15
-rw-r--r--cli-tests/merge/buildfile (renamed from tests/merge/buildfile)2
-rw-r--r--cli-tests/merge/driver.cxx (renamed from tests/merge/driver.cxx)2
-rw-r--r--cli-tests/merge/test.cli (renamed from tests/merge/test.cli)2
-rw-r--r--cli-tests/note/buildfile6
-rw-r--r--cli-tests/note/testscript (renamed from tests/note/testscript)4
-rw-r--r--cli-tests/specifier/buildfile (renamed from tests/specifier/buildfile)2
-rw-r--r--cli-tests/specifier/driver.cxx (renamed from tests/specifier/driver.cxx)2
-rw-r--r--cli-tests/specifier/test.cli (renamed from tests/specifier/test.cli)2
-rw-r--r--cli-tests/toc/buildfile6
-rw-r--r--cli-tests/toc/testscript (renamed from tests/toc/testscript)4
-rw-r--r--cli/.gitignore21
-rw-r--r--cli/INSTALL6
l---------cli/LICENSE1
-rw-r--r--cli/NEWS (renamed from NEWS)0
-rw-r--r--cli/README (renamed from README)0
-rw-r--r--cli/build/.gitignore (renamed from build/.gitignore)0
-rw-r--r--cli/build/bootstrap.build10
-rw-r--r--cli/build/export.build (renamed from build/export.build)0
-rw-r--r--cli/build/root.build60
-rw-r--r--cli/buildfile55
-rw-r--r--cli/cli/.gitignore7
-rw-r--r--cli/cli/buildfile75
-rw-r--r--cli/cli/cli.cxx (renamed from cli/cli.cxx)0
-rw-r--r--cli/cli/context.cxx (renamed from cli/context.cxx)0
-rw-r--r--cli/cli/context.hxx (renamed from cli/context.hxx)0
-rw-r--r--cli/cli/generator.cxx (renamed from cli/generator.cxx)0
-rw-r--r--cli/cli/generator.hxx (renamed from cli/generator.hxx)0
-rw-r--r--cli/cli/header.cxx (renamed from cli/header.cxx)0
-rw-r--r--cli/cli/header.hxx (renamed from cli/header.hxx)0
-rw-r--r--cli/cli/html.cxx (renamed from cli/html.cxx)0
-rw-r--r--cli/cli/html.hxx (renamed from cli/html.hxx)0
-rw-r--r--cli/cli/inline.cxx (renamed from cli/inline.cxx)0
-rw-r--r--cli/cli/inline.hxx (renamed from cli/inline.hxx)0
-rw-r--r--cli/cli/lexer.cxx (renamed from cli/lexer.cxx)0
-rw-r--r--cli/cli/lexer.hxx (renamed from cli/lexer.hxx)0
-rw-r--r--cli/cli/lexer.ixx (renamed from cli/lexer.ixx)0
-rw-r--r--cli/cli/lexer.test.cxx (renamed from unit-tests/lexer/driver.cxx)2
-rw-r--r--cli/cli/lexer.test.testscript (renamed from unit-tests/lexer/testscript)2
-rw-r--r--cli/cli/man.cxx (renamed from cli/man.cxx)0
-rw-r--r--cli/cli/man.hxx (renamed from cli/man.hxx)0
-rw-r--r--cli/cli/name-processor.cxx (renamed from cli/name-processor.cxx)0
-rw-r--r--cli/cli/name-processor.hxx (renamed from cli/name-processor.hxx)0
-rw-r--r--cli/cli/option-types.cxx (renamed from cli/option-types.cxx)0
-rw-r--r--cli/cli/option-types.hxx (renamed from cli/option-types.hxx)0
-rw-r--r--cli/cli/options.cli (renamed from cli/options.cli)0
-rw-r--r--cli/cli/options.cxx (renamed from cli/options.cxx)0
-rw-r--r--cli/cli/options.hxx (renamed from cli/options.hxx)0
-rw-r--r--cli/cli/options.ixx (renamed from cli/options.ixx)0
-rw-r--r--cli/cli/parser.cxx (renamed from cli/parser.cxx)0
-rw-r--r--cli/cli/parser.hxx (renamed from cli/parser.hxx)0
-rw-r--r--cli/cli/parser.test.cxx (renamed from unit-tests/parser/driver.cxx)2
-rw-r--r--cli/cli/parser.test.testscript (renamed from unit-tests/parser/testscript)2
-rw-r--r--cli/cli/runtime-header.cxx (renamed from cli/runtime-header.cxx)0
-rw-r--r--cli/cli/runtime-header.hxx (renamed from cli/runtime-header.hxx)0
-rw-r--r--cli/cli/runtime-inline.cxx (renamed from cli/runtime-inline.cxx)0
-rw-r--r--cli/cli/runtime-inline.hxx (renamed from cli/runtime-inline.hxx)0
-rw-r--r--cli/cli/runtime-source.cxx (renamed from cli/runtime-source.cxx)0
-rw-r--r--cli/cli/runtime-source.hxx (renamed from cli/runtime-source.hxx)0
-rw-r--r--cli/cli/semantics.hxx (renamed from cli/semantics.hxx)0
-rw-r--r--cli/cli/semantics/class.cxx (renamed from cli/semantics/class.cxx)0
-rw-r--r--cli/cli/semantics/class.hxx (renamed from cli/semantics/class.hxx)0
-rw-r--r--cli/cli/semantics/doc.cxx (renamed from cli/semantics/doc.cxx)0
-rw-r--r--cli/cli/semantics/doc.hxx (renamed from cli/semantics/doc.hxx)0
-rw-r--r--cli/cli/semantics/elements.cxx (renamed from cli/semantics/elements.cxx)0
-rw-r--r--cli/cli/semantics/elements.hxx (renamed from cli/semantics/elements.hxx)0
-rw-r--r--cli/cli/semantics/expression.cxx (renamed from cli/semantics/expression.cxx)0
-rw-r--r--cli/cli/semantics/expression.hxx (renamed from cli/semantics/expression.hxx)0
-rw-r--r--cli/cli/semantics/namespace.cxx (renamed from cli/semantics/namespace.cxx)0
-rw-r--r--cli/cli/semantics/namespace.hxx (renamed from cli/semantics/namespace.hxx)0
-rw-r--r--cli/cli/semantics/option.cxx (renamed from cli/semantics/option.cxx)0
-rw-r--r--cli/cli/semantics/option.hxx (renamed from cli/semantics/option.hxx)0
-rw-r--r--cli/cli/semantics/unit.cxx (renamed from cli/semantics/unit.cxx)0
-rw-r--r--cli/cli/semantics/unit.hxx (renamed from cli/semantics/unit.hxx)0
-rw-r--r--cli/cli/semantics/unit.txx (renamed from cli/semantics/unit.txx)0
-rw-r--r--cli/cli/source.cxx (renamed from cli/source.cxx)0
-rw-r--r--cli/cli/source.hxx (renamed from cli/source.hxx)0
-rw-r--r--cli/cli/token.hxx (renamed from cli/token.hxx)0
-rw-r--r--cli/cli/token.ixx (renamed from cli/token.ixx)0
-rw-r--r--cli/cli/traversal.hxx (renamed from cli/traversal.hxx)0
-rw-r--r--cli/cli/traversal/class.cxx (renamed from cli/traversal/class.cxx)0
-rw-r--r--cli/cli/traversal/class.hxx (renamed from cli/traversal/class.hxx)0
-rw-r--r--cli/cli/traversal/doc.hxx (renamed from cli/traversal/doc.hxx)0
-rw-r--r--cli/cli/traversal/elements.cxx (renamed from cli/traversal/elements.cxx)0
-rw-r--r--cli/cli/traversal/elements.hxx (renamed from cli/traversal/elements.hxx)0
-rw-r--r--cli/cli/traversal/expression.hxx (renamed from cli/traversal/expression.hxx)0
-rw-r--r--cli/cli/traversal/namespace.cxx (renamed from cli/traversal/namespace.cxx)0
-rw-r--r--cli/cli/traversal/namespace.hxx (renamed from cli/traversal/namespace.hxx)0
-rw-r--r--cli/cli/traversal/option.cxx (renamed from cli/traversal/option.cxx)0
-rw-r--r--cli/cli/traversal/option.hxx (renamed from cli/traversal/option.hxx)0
-rw-r--r--cli/cli/traversal/unit.cxx (renamed from cli/traversal/unit.cxx)0
-rw-r--r--cli/cli/traversal/unit.hxx (renamed from cli/traversal/unit.hxx)0
-rw-r--r--cli/cli/txt.cxx (renamed from cli/txt.cxx)0
-rw-r--r--cli/cli/txt.hxx (renamed from cli/txt.hxx)0
-rw-r--r--cli/cli/version.hxx.in (renamed from cli/version.hxx.in)0
-rw-r--r--cli/doc/.gitignore2
-rw-r--r--cli/doc/buildfile20
-rw-r--r--cli/doc/cli-epilogue.1 (renamed from doc/cli-epilogue.1)0
-rw-r--r--cli/doc/cli-epilogue.xhtml (renamed from doc/cli-epilogue.xhtml)0
-rw-r--r--cli/doc/cli-prologue.1 (renamed from doc/cli-prologue.1)0
-rw-r--r--cli/doc/cli-prologue.xhtml (renamed from doc/cli-prologue.xhtml)0
-rw-r--r--cli/doc/default.css (renamed from doc/default.css)0
-rwxr-xr-xcli/doc/doc.sh (renamed from doc/doc.sh)4
-rw-r--r--cli/doc/guide/.gitignore (renamed from doc/guide/.gitignore)0
-rw-r--r--cli/doc/guide/guide.html2ps (renamed from doc/guide/guide.html2ps)0
-rw-r--r--cli/doc/guide/index.xhtml (renamed from doc/guide/index.xhtml)0
-rw-r--r--cli/doc/language.txt (renamed from doc/language.txt)0
-rw-r--r--cli/manifest (renamed from manifest)8
-rw-r--r--doc/cli.1412
-rw-r--r--doc/cli.xhtml568
-rw-r--r--doc/guide/makefile39
-rw-r--r--doc/makefile44
-rw-r--r--examples/.gitignore1
-rw-r--r--examples/build/root.build36
-rw-r--r--examples/buildfile4
-rw-r--r--packages.manifest6
-rw-r--r--tests/.gitignore2
-rw-r--r--tests/build/root.build36
-rw-r--r--tests/buildfile4
-rw-r--r--tests/headings/buildfile4
-rw-r--r--tests/note/buildfile4
-rw-r--r--tests/toc/buildfile4
-rw-r--r--unit-tests/.gitignore1
-rw-r--r--unit-tests/lexer/buildfile5
-rw-r--r--unit-tests/parser/buildfile5
185 files changed, 458 insertions, 1444 deletions
diff --git a/.gitignore b/.gitignore
index c3de2e7..13d880b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,21 +1 @@
.bdep/
-
-# Compiler/linker output.
-#
-*.d
-*.t
-*.i
-*.ii
-*.o
-*.obj
-*.so
-*.dll
-*.a
-*.lib
-*.exp
-*.pdb
-*.ilk
-*.exe
-*.exe.dlls/
-*.exe.manifest
-*.pc
diff --git a/INSTALL b/INSTALL
index d4204a2..19bc883 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,62 +1,30 @@
-General
--------
-
-Unless you are using the cli+dep package, you will also need to install
-the following dependencies:
-
- libcutl >= 1.1.0 http://www.codesynthesis.com/projects/libcutl/
-
-Additionally, for UNIX-like operating systems:
-
- build >= 0.3.5 http://www.codesynthesis.com/projects/build/
-
-The cli+dep package comes with the necessary dependencies bundled.
-
-
-UNIX
-----
-
-Building on UNIX-like operating systems requires GNU make 3.81 or later.
-Most recent GNU/Linux distributions should already have this version
-installed. To check the GNU make version run make (or gmake) with the
---version option.
-
-To build the compiler, tests, and examples simply run make in the root
-directory of the package. To run the automated test suite, run 'make test'.
-To clean the object files, executables, etc., run 'make clean'. To de-
-configure the package (that is, remove configuration files in addition
-to objects, executables, etc.), run 'make disfigure'.
-
-To install the CLI compiler, examples, and documentation use the install
-target, for example:
-
-$ make install_prefix=/usr install
-
-You can fine-tune the installation locations with the following make
-variables:
-
-install_prefix default is /usr/local
-install_data_prefix default is install_prefix
-install_exec_prefix default is install_prefix
-
-install_bin_dir default is install_exec_prefix/bin
-install_sbin_dir default is install_exec_prefix/sbin
-install_lib_dir default is install_exec_prefix/lib
-
-install_data_dir default is install_data_prefix/share
-install_inc_dir default is install_data_prefix/include
-
-install_doc_dir default is install_data_dir/doc
-install_man_dir default is install_data_dir/man
-install_info_dir default is install_data_dir/info
-
-
-Windows
--------
-
-Project and solution files are provided for Visual C++ 8.0 (2005) and
-9.0 (2008). To build the CLI compiler, open and build the corresponding
-solution file in the cli\ directory. After the build is complete, the
-compiler executable can be found in the cli\ directory. You can also
-build examples by opening and building one of the solution files in the
-examples\ directory.
+CLI uses itself for command line options parsing which makes it a bit tricky
+to develop. Below is one way to setup the development environment:
+
+$ git clone .../cli.git
+$ cd cli
+$ bdep init -C ../builds/main @main cc # Main build.
+$ bdep update # Using pre-geneared code.
+$ bdep init -d cli/ -C ../builds/save @save cc # "Saved" build.
+$ bdep update @save
+
+# @@ This does not currently work because bdep (bpkg) will drop it on next
+# sync (reconfigure).
+#
+#$ b configure: ../builds/main/cli/ \
+# config.cli="$(realpath ../builds/save/cli/cli/cli)"
+
+$ echo >>../builds/main/build/config.build \
+ "cli/ config.cli=$(realpath ../builds/save/cli/cli/cli)"
+
+$ bdep update # Regenerate code.
+
+Then, when making changes that affect the generated code, perform the
+following sequence of steps (the key thing to keep in mind is that the saved
+configuration will use generated code from source directory that is
+backlinked during the main build):
+
+$ b cli/ # Regenerate using old saved.
+$ bdep update @save # Update saved.
+$ b cli/ # Regenerate using new saved.
+$ bdep update @save # Update saved.
diff --git a/build/bootstrap.build b/build/bootstrap.build
deleted file mode 100644
index cd43c15..0000000
--- a/build/bootstrap.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# file : build/bootstrap.build
-# license : MIT; see accompanying LICENSE file
-
-project = cli
-
-using version
-
-# By default leave the cli module unconfigured since we don't want to use some
-# system-installed cli. Note that this value will be overridden if set either
-# on the command line or in config.build.
-#
-config.cli = false
-
-using config
-
-using dist
-using test
-using install
diff --git a/build/root.build b/build/root.build
deleted file mode 100644
index 0a536ca..0000000
--- a/build/root.build
+++ /dev/null
@@ -1,37 +0,0 @@
-# file : build/root.build
-# license : MIT; see accompanying LICENSE file
-
-cxx.std = latest
-
-using cxx
-
-hxx{*}: extension = hxx
-ixx{*}: extension = ixx
-txx{*}: extension = txx
-cxx{*}: extension = cxx
-
-if ($cxx.target.system == 'win32-msvc')
- cxx.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
-
-if ($cxx.class == 'msvc')
- cxx.coptions += /wd4251 /wd4275 /wd4800
-
-cxx.poptions =+ "-I$out_root" "-I$src_root"
-
-# Load the cli module but only if it's available. This way a distribution
-# that includes pre-generated files can be built without installing cli.
-# This is also the reason why we need to explicitly spell out individual
-# source file prerequisites instead of using the cli.cxx{} group (it won't
-# be there unless the module is configured).
-#
-using? cli
-
-# All exe{} in unit-tests/ are, well, tests. Also don't link whole archives
-# by default there.
-#
-unit-tests/exe{*}: test = true
-unit-tests/{libue libul}{*}: bin.whole = false
-
-# Specify the test target for cross-testing.
-#
-test.target = $cxx.target
diff --git a/buildfile b/buildfile
deleted file mode 100644
index 394230e..0000000
--- a/buildfile
+++ /dev/null
@@ -1,30 +0,0 @@
-# file : buildfile
-# license : MIT; see accompanying LICENSE file
-
-d = cli/ unit-tests/
-
-# Building examples/ and tests/ while bootstrapping the compiler is tricky.
-# What we are going to do is omit these two directories if there is no cli
-# compiler yet. Once it's built the user can reconfigure the project which
-# will enable tests and examples. Alternatively, the user can install the
-# compiler and test the installation with out-of-tree builds of tests/ and
-# examples/.
-#
-# Note that to make sure we don't pick up some system-installed cli, we
-# default (in bootstrap.build) to leaving the cli module unconfigured.
-#
-# Also note that creating distribution with the cli module unconfigured, you
-# will end up with incomplete distribution directory (without tests, examples
-# and options.cli file).
-#
-if $cli.configured
- d += tests/ examples/
-
-./: $d doc{INSTALL LICENSE NEWS README} manifest
-
-# Don't install examples, tests or the INSTALL file.
-#
-examples/: install = false
-tests/: install = false
-unit-tests/: install = false
-doc{INSTALL}@./: install = false
diff --git a/cli-examples/.gitignore b/cli-examples/.gitignore
new file mode 100644
index 0000000..e1d6ab8
--- /dev/null
+++ b/cli-examples/.gitignore
@@ -0,0 +1,21 @@
+# Compiler/linker output.
+#
+*.d
+*.t
+*.i
+*.ii
+*.o
+*.obj
+*.so
+*.dll
+*.a
+*.lib
+*.exp
+*.pdb
+*.ilk
+*.exe
+*.exe.dlls/
+*.exe.manifest
+*.pc
+
+driver
diff --git a/cli-examples/LICENSE b/cli-examples/LICENSE
new file mode 120000
index 0000000..ea5b606
--- /dev/null
+++ b/cli-examples/LICENSE
@@ -0,0 +1 @@
+../LICENSE \ No newline at end of file
diff --git a/examples/README b/cli-examples/README
index 84ef156..11589d2 100644
--- a/examples/README
+++ b/cli-examples/README
@@ -1,4 +1,4 @@
-This directory contains a number of examples that show how to use the CLI
+This package contains a number of examples that show how to use the CLI
language and compiler to implement command line interface parsing in C++.
The following list gives an overview of each example. See the README files
in example directories for more information on each example.
diff --git a/examples/build/.gitignore b/cli-examples/build/.gitignore
index 4a730a3..4a730a3 100644
--- a/examples/build/.gitignore
+++ b/cli-examples/build/.gitignore
diff --git a/tests/build/bootstrap.build b/cli-examples/build/bootstrap.build
index c9187a6..c50c6ac 100644
--- a/tests/build/bootstrap.build
+++ b/cli-examples/build/bootstrap.build
@@ -1,8 +1,9 @@
-# file : tests/build/bootstrap.build
+# file : build/bootstrap.build
# license : MIT; see accompanying LICENSE file
-project = # Unnamed subproject.
+project = cli-examples
+using version
using config
using dist
using test
diff --git a/cli-examples/build/root.build b/cli-examples/build/root.build
new file mode 100644
index 0000000..53bde39
--- /dev/null
+++ b/cli-examples/build/root.build
@@ -0,0 +1,27 @@
+# file : build/root.build
+# license : MIT; see accompanying LICENSE file
+
+cxx.std = latest
+
+using cxx
+
+hxx{*}: extension = hxx
+ixx{*}: extension = ixx
+txx{*}: extension = txx
+cxx{*}: extension = cxx
+
+if ($cxx.target.system == 'win32-msvc')
+ cxx.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
+
+if ($cxx.class == 'msvc')
+ cxx.coptions += /wd4251 /wd4275 /wd4800
+
+using cli
+
+# Every exe{} in this subproject is by default a test.
+#
+exe{*}: test = true
+
+# Specify the test target for cross-testing.
+#
+test.target = $cxx.target
diff --git a/cli-examples/buildfile b/cli-examples/buildfile
new file mode 100644
index 0000000..53d51dd
--- /dev/null
+++ b/cli-examples/buildfile
@@ -0,0 +1,4 @@
+# file : buildfile
+# license : MIT; see accompanying LICENSE file
+
+./: {*/ -build/} doc{LICENSE README} manifest
diff --git a/examples/features/.gitignore b/cli-examples/features/.gitignore
index c6e608b..c6e608b 100644
--- a/examples/features/.gitignore
+++ b/cli-examples/features/.gitignore
diff --git a/examples/features/README b/cli-examples/features/README
index 9416320..9416320 100644
--- a/examples/features/README
+++ b/cli-examples/features/README
diff --git a/examples/features/buildfile b/cli-examples/features/buildfile
index 29ce2c7..5051eae 100644
--- a/examples/features/buildfile
+++ b/cli-examples/features/buildfile
@@ -1,4 +1,4 @@
-# file : examples/features/buildfile
+# file : features/buildfile
# license : MIT; see accompanying LICENSE file
exe{driver}: {hxx cxx}{* -options} cli.cxx{options} doc{README}
diff --git a/examples/features/driver.cxx b/cli-examples/features/driver.cxx
index 33ba362..c14b5c7 100644
--- a/examples/features/driver.cxx
+++ b/cli-examples/features/driver.cxx
@@ -1,4 +1,4 @@
-// file : examples/features/driver.cxx
+// file : features/driver.cxx
// author : Boris Kolpackov <boris@codesynthesis.com>
// license : MIT; see accompanying LICENSE file
diff --git a/examples/features/options.cli b/cli-examples/features/options.cli
index ea055b3..ea055b3 100644
--- a/examples/features/options.cli
+++ b/cli-examples/features/options.cli
diff --git a/examples/file/.gitignore b/cli-examples/file/.gitignore
index c6e608b..c6e608b 100644
--- a/examples/file/.gitignore
+++ b/cli-examples/file/.gitignore
diff --git a/examples/file/README b/cli-examples/file/README
index 289fc64..289fc64 100644
--- a/examples/file/README
+++ b/cli-examples/file/README
diff --git a/examples/file/buildfile b/cli-examples/file/buildfile
index eadfc66..89675d8 100644
--- a/examples/file/buildfile
+++ b/cli-examples/file/buildfile
@@ -1,4 +1,4 @@
-# file : examples/file/buildfile
+# file : file/buildfile
# license : MIT; see accompanying LICENSE file
exe{driver}: {hxx cxx}{* -options} cli.cxx{options} doc{README}
diff --git a/examples/file/driver.cxx b/cli-examples/file/driver.cxx
index d187559..b53574c 100644
--- a/examples/file/driver.cxx
+++ b/cli-examples/file/driver.cxx
@@ -1,4 +1,4 @@
-// file : examples/file/driver.cxx
+// file : file/driver.cxx
// author : Boris Kolpackov <boris@codesynthesis.com>
// license : MIT; see accompanying LICENSE file
diff --git a/examples/file/options.cli b/cli-examples/file/options.cli
index 3e6db5a..3e6db5a 100644
--- a/examples/file/options.cli
+++ b/cli-examples/file/options.cli
diff --git a/examples/file/test.ops b/cli-examples/file/test.ops
index 65fcf07..65fcf07 100644
--- a/examples/file/test.ops
+++ b/cli-examples/file/test.ops
diff --git a/examples/hello/.gitignore b/cli-examples/hello/.gitignore
index d73130a..d73130a 100644
--- a/examples/hello/.gitignore
+++ b/cli-examples/hello/.gitignore
diff --git a/examples/hello/README b/cli-examples/hello/README
index dd14b01..dd14b01 100644
--- a/examples/hello/README
+++ b/cli-examples/hello/README
diff --git a/examples/hello/buildfile b/cli-examples/hello/buildfile
index 9a11b29..8197d9e 100644
--- a/examples/hello/buildfile
+++ b/cli-examples/hello/buildfile
@@ -1,4 +1,4 @@
-# file : examples/hello/buildfile
+# file : hello/buildfile
# license : MIT; see accompanying LICENSE file
exe{driver}: {hxx cxx}{* -hello} cli.cxx{hello} doc{README}
diff --git a/examples/hello/driver.cxx b/cli-examples/hello/driver.cxx
index 30fdf6e..bc37564 100644
--- a/examples/hello/driver.cxx
+++ b/cli-examples/hello/driver.cxx
@@ -1,4 +1,4 @@
-// file : examples/hello/driver.cxx
+// file : hello/driver.cxx
// author : Boris Kolpackov <boris@codesynthesis.com>
// license : MIT; see accompanying LICENSE file
diff --git a/examples/hello/hello.cli b/cli-examples/hello/hello.cli
index b75e1b8..b75e1b8 100644
--- a/examples/hello/hello.cli
+++ b/cli-examples/hello/hello.cli
diff --git a/cli-examples/manifest b/cli-examples/manifest
new file mode 100644
index 0000000..9ef14f3
--- /dev/null
+++ b/cli-examples/manifest
@@ -0,0 +1,15 @@
+: 1
+name: cli-examples
+version: 1.2.0-b.6.z
+project: cli
+summary: Examples of using the CLI language and compiler for C++
+license: MIT
+description-file: README
+url: https://www.codesynthesis.com/projects/cli/
+doc-url: https://www.codesynthesis.com/projects/cli/doc/guide/
+src-url: https://git.codesynthesis.com/cgit/cli/cli/tree/cli-examples
+email: cli-users@codesynthesis.com ; Mailing list
+build-email: builds@codesynthesis.com
+requires: c++14
+depends: * build2 >= 0.13.0-
+depends: * bpkg >= 0.13.0-
diff --git a/cli-tests/.gitignore b/cli-tests/.gitignore
new file mode 100644
index 0000000..0b99f39
--- /dev/null
+++ b/cli-tests/.gitignore
@@ -0,0 +1,22 @@
+# Compiler/linker output.
+#
+*.d
+*.t
+*.i
+*.ii
+*.o
+*.obj
+*.so
+*.dll
+*.a
+*.lib
+*.exp
+*.pdb
+*.ilk
+*.exe
+*.exe.dlls/
+*.exe.manifest
+*.pc
+
+driver
+test.?xx
diff --git a/cli-tests/LICENSE b/cli-tests/LICENSE
new file mode 120000
index 0000000..ea5b606
--- /dev/null
+++ b/cli-tests/LICENSE
@@ -0,0 +1 @@
+../LICENSE \ No newline at end of file
diff --git a/cli-tests/README b/cli-tests/README
new file mode 100644
index 0000000..28e7868
--- /dev/null
+++ b/cli-tests/README
@@ -0,0 +1,8 @@
+This package contains tests for the CLI compiler for C++.
+
+See the LICENSE file for distribution conditions.
+
+The project page is at http://codesynthesis.com/projects/cli/.
+
+Send questions, bug reports, or any other feedback to
+cli-users@codesynthesis.com.
diff --git a/tests/build/.gitignore b/cli-tests/build/.gitignore
index 4a730a3..4a730a3 100644
--- a/tests/build/.gitignore
+++ b/cli-tests/build/.gitignore
diff --git a/examples/build/bootstrap.build b/cli-tests/build/bootstrap.build
index 78d91f7..f5c693e 100644
--- a/examples/build/bootstrap.build
+++ b/cli-tests/build/bootstrap.build
@@ -1,8 +1,9 @@
-# file : examples/build/bootstrap.build
+# file : build/bootstrap.build
# license : MIT; see accompanying LICENSE file
-project = # Unnamed subproject.
+project = cli-tests
+using version
using config
using dist
using test
diff --git a/cli-tests/build/root.build b/cli-tests/build/root.build
new file mode 100644
index 0000000..53bde39
--- /dev/null
+++ b/cli-tests/build/root.build
@@ -0,0 +1,27 @@
+# file : build/root.build
+# license : MIT; see accompanying LICENSE file
+
+cxx.std = latest
+
+using cxx
+
+hxx{*}: extension = hxx
+ixx{*}: extension = ixx
+txx{*}: extension = txx
+cxx{*}: extension = cxx
+
+if ($cxx.target.system == 'win32-msvc')
+ cxx.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
+
+if ($cxx.class == 'msvc')
+ cxx.coptions += /wd4251 /wd4275 /wd4800
+
+using cli
+
+# Every exe{} in this subproject is by default a test.
+#
+exe{*}: test = true
+
+# Specify the test target for cross-testing.
+#
+test.target = $cxx.target
diff --git a/cli-tests/buildfile b/cli-tests/buildfile
new file mode 100644
index 0000000..53d51dd
--- /dev/null
+++ b/cli-tests/buildfile
@@ -0,0 +1,4 @@
+# file : buildfile
+# license : MIT; see accompanying LICENSE file
+
+./: {*/ -build/} doc{LICENSE README} manifest
diff --git a/tests/combined/buildfile b/cli-tests/combined/buildfile
index 7d1e167..943ca25 100644
--- a/tests/combined/buildfile
+++ b/cli-tests/combined/buildfile
@@ -1,4 +1,4 @@
-# file : tests/combined/buildfile
+# file : combined/buildfile
# license : MIT; see accompanying LICENSE file
exe{driver}: {hxx cxx}{* -test} cli.cxx{test} testscript
diff --git a/tests/combined/driver.cxx b/cli-tests/combined/driver.cxx
index ace3e64..dcbdd34 100644
--- a/tests/combined/driver.cxx
+++ b/cli-tests/combined/driver.cxx
@@ -1,4 +1,4 @@
-// file : tests/combined/driver.cxx
+// file : combined/driver.cxx
// author : Boris Kolpackov <boris@codesynthesis.com>
// license : MIT; see accompanying LICENSE file
diff --git a/tests/combined/test.cli b/cli-tests/combined/test.cli
index 1576859..6377de8 100644
--- a/tests/combined/test.cli
+++ b/cli-tests/combined/test.cli
@@ -1,4 +1,4 @@
-// file : tests/combined/test.cli
+// file : combined/test.cli
// author : Boris Kolpackov <boris@codesynthesis.com>
// license : MIT; see accompanying LICENSE file
diff --git a/tests/combined/testscript b/cli-tests/combined/testscript
index 986ed02..d1f9830 100644
--- a/tests/combined/testscript
+++ b/cli-tests/combined/testscript
@@ -1,4 +1,4 @@
-# file : tests/combined/testscript
+# file : combined/testscript
# license : MIT; see accompanying LICENSE file
: values
diff --git a/tests/ctor/buildfile b/cli-tests/ctor/buildfile
index e41e87f..4144988 100644
--- a/tests/ctor/buildfile
+++ b/cli-tests/ctor/buildfile
@@ -1,4 +1,4 @@
-# file : tests/ctor/buildfile
+# file : ctor/buildfile
# license : MIT; see accompanying LICENSE file
exe{driver}: {hxx cxx}{* -test} cli.cxx{test}
diff --git a/tests/ctor/driver.cxx b/cli-tests/ctor/driver.cxx
index cf7ec3b..ed306f4 100644
--- a/tests/ctor/driver.cxx
+++ b/cli-tests/ctor/driver.cxx
@@ -1,4 +1,4 @@
-// file : tests/ctor/driver.cxx
+// file : ctor/driver.cxx
// author : Boris Kolpackov <boris@codesynthesis.com>
// license : MIT; see accompanying LICENSE file
diff --git a/tests/ctor/test.cli b/cli-tests/ctor/test.cli
index 869418d..94797fb 100644
--- a/tests/ctor/test.cli
+++ b/cli-tests/ctor/test.cli
@@ -1,4 +1,4 @@
-// file : tests/ctor/test.cli
+// file : ctor/test.cli
// author : Boris Kolpackov <boris@codesynthesis.com>
// license : MIT; see accompanying LICENSE file
diff --git a/tests/erase/buildfile b/cli-tests/erase/buildfile
index 7b2ebbd..024e021 100644
--- a/tests/erase/buildfile
+++ b/cli-tests/erase/buildfile
@@ -1,4 +1,4 @@
-# file : tests/erase/buildfile
+# file : erase/buildfile
# license : MIT; see accompanying LICENSE file
exe{driver}: {hxx cxx}{* -test} cli.cxx{test}
diff --git a/tests/erase/driver.cxx b/cli-tests/erase/driver.cxx
index e2207ef..af35836 100644
--- a/tests/erase/driver.cxx
+++ b/cli-tests/erase/driver.cxx
@@ -1,4 +1,4 @@
-// file : tests/erase/driver.cxx
+// file : erase/driver.cxx
// author : Boris Kolpackov <boris@codesynthesis.com>
// license : MIT; see accompanying LICENSE file
diff --git a/tests/erase/test.cli b/cli-tests/erase/test.cli
index 7c14b69..a5d7672 100644
--- a/tests/erase/test.cli
+++ b/cli-tests/erase/test.cli
@@ -1,4 +1,4 @@
-// file : tests/erase/test.cli
+// file : erase/test.cli
// author : Boris Kolpackov <boris@codesynthesis.com>
// license : MIT; see accompanying LICENSE file
diff --git a/tests/file/buildfile b/cli-tests/file/buildfile
index c5e4dd4..793d2a9 100644
--- a/tests/file/buildfile
+++ b/cli-tests/file/buildfile
@@ -1,4 +1,4 @@
-# file : tests/file/buildfile
+# file : file/buildfile
# license : MIT; see accompanying LICENSE file
exe{driver}: {hxx cxx}{* -test} cli.cxx{test} testscript
diff --git a/tests/file/driver.cxx b/cli-tests/file/driver.cxx
index f964932..eef7ef1 100644
--- a/tests/file/driver.cxx
+++ b/cli-tests/file/driver.cxx
@@ -1,4 +1,4 @@
-// file : tests/file/driver.cxx
+// file : file/driver.cxx
// author : Boris Kolpackov <boris@codesynthesis.com>
// license : MIT; see accompanying LICENSE file
diff --git a/tests/file/test.cli b/cli-tests/file/test.cli
index 617f42a..c72a495 100644
--- a/tests/file/test.cli
+++ b/cli-tests/file/test.cli
@@ -1,4 +1,4 @@
-// file : tests/file/test.cli
+// file : file/test.cli
// author : Boris Kolpackov <boris@codesynthesis.com>
// license : MIT; see accompanying LICENSE file
diff --git a/tests/file/testscript b/cli-tests/file/testscript
index f4d04a7..d86ec1d 100644
--- a/tests/file/testscript
+++ b/cli-tests/file/testscript
@@ -1,4 +1,4 @@
-# file : tests/file/testscript
+# file : file/testscript
# license : MIT; see accompanying LICENSE file
# End-of-line marker. Place its expansion in here-documents after the trailing
diff --git a/tests/group/buildfile b/cli-tests/group/buildfile
index 427c68d..30327e0 100644
--- a/tests/group/buildfile
+++ b/cli-tests/group/buildfile
@@ -1,4 +1,4 @@
-# file : tests/group/buildfile
+# file : group/buildfile
# license : MIT; see accompanying LICENSE file
exe{driver}: {hxx cxx}{* -test} cli.cxx{test} testscript
diff --git a/tests/group/driver.cxx b/cli-tests/group/driver.cxx
index f24cdd8..68f6107 100644
--- a/tests/group/driver.cxx
+++ b/cli-tests/group/driver.cxx
@@ -1,4 +1,4 @@
-// file : tests/group/driver.cxx
+// file : group/driver.cxx
// author : Boris Kolpackov <boris@codesynthesis.com>
// license : MIT; see accompanying LICENSE file
diff --git a/tests/group/test.cli b/cli-tests/group/test.cli
index f4c1584..8725791 100644
--- a/tests/group/test.cli
+++ b/cli-tests/group/test.cli
@@ -1,4 +1,4 @@
-// file : tests/group/test.cli
+// file : group/test.cli
// author : Boris Kolpackov <boris@codesynthesis.com>
// license : MIT; see accompanying LICENSE file
diff --git a/tests/group/testscript b/cli-tests/group/testscript
index 1370cbe..6269ca2 100644
--- a/tests/group/testscript
+++ b/cli-tests/group/testscript
@@ -1,4 +1,4 @@
-# file : tests/group/testscript
+# file : group/testscript
# license : MIT; see accompanying LICENSE file
: no-args
diff --git a/cli-tests/headings/buildfile b/cli-tests/headings/buildfile
new file mode 100644
index 0000000..af3ae75
--- /dev/null
+++ b/cli-tests/headings/buildfile
@@ -0,0 +1,6 @@
+# file : headings/buildfile
+# license : MIT; see accompanying LICENSE file
+
+./: testscript $cli
+
+testscript{*}: test = $cli
diff --git a/tests/headings/testscript b/cli-tests/headings/testscript
index 0827890..0efb7ae 100644
--- a/tests/headings/testscript
+++ b/cli-tests/headings/testscript
@@ -1,8 +1,6 @@
-# file : tests/headings/testscript
+# file : headings/testscript
# license : MIT; see accompanying LICENSE file
-test = $effect($cli.path)
-
: auto-headings
:
: Note that auto-headings break if we split into multiple doc strings.
diff --git a/tests/inheritance/buildfile b/cli-tests/inheritance/buildfile
index f1b72ce..6fe1ecc 100644
--- a/tests/inheritance/buildfile
+++ b/cli-tests/inheritance/buildfile
@@ -1,4 +1,4 @@
-# file : tests/inheritance/buildfile
+# file : inheritance/buildfile
# license : MIT; see accompanying LICENSE file
exe{driver}: {hxx cxx}{* -test} cli.cxx{test}
diff --git a/tests/inheritance/driver.cxx b/cli-tests/inheritance/driver.cxx
index 5ecb019..4acab0d 100644
--- a/tests/inheritance/driver.cxx
+++ b/cli-tests/inheritance/driver.cxx
@@ -1,4 +1,4 @@
-// file : tests/inheritance/driver.cxx
+// file : inheritance/driver.cxx
// author : Boris Kolpackov <boris@codesynthesis.com>
// license : MIT; see accompanying LICENSE file
diff --git a/tests/inheritance/test.cli b/cli-tests/inheritance/test.cli
index 9e43bb5..3b73848 100644
--- a/tests/inheritance/test.cli
+++ b/cli-tests/inheritance/test.cli
@@ -1,4 +1,4 @@
-// file : tests/inheritance/test.cli
+// file : inheritance/test.cli
// author : Boris Kolpackov <boris@codesynthesis.com>
// license : MIT; see accompanying LICENSE file
diff --git a/tests/inheritance/test.std b/cli-tests/inheritance/test.std
index 4c93225..4c93225 100644
--- a/tests/inheritance/test.std
+++ b/cli-tests/inheritance/test.std
diff --git a/cli-tests/manifest b/cli-tests/manifest
new file mode 100644
index 0000000..a7898ce
--- /dev/null
+++ b/cli-tests/manifest
@@ -0,0 +1,15 @@
+: 1
+name: cli-tests
+version: 1.2.0-b.6.z
+project: cli
+summary: Tests for the CLI compiler for C++
+license: MIT
+description-file: README
+url: https://www.codesynthesis.com/projects/cli/
+doc-url: https://www.codesynthesis.com/projects/cli/doc/guide/
+src-url: https://git.codesynthesis.com/cgit/cli/cli/tree/cli-tests
+email: cli-users@codesynthesis.com ; Mailing list
+build-email: builds@codesynthesis.com
+requires: c++14
+depends: * build2 >= 0.13.0-
+depends: * bpkg >= 0.13.0-
diff --git a/tests/merge/buildfile b/cli-tests/merge/buildfile
index d786ad8..ed93cda 100644
--- a/tests/merge/buildfile
+++ b/cli-tests/merge/buildfile
@@ -1,4 +1,4 @@
-# file : tests/merge/buildfile
+# file : merge/buildfile
# license : MIT; see accompanying LICENSE file
exe{driver}: {hxx cxx}{* -test} cli.cxx{test}
diff --git a/tests/merge/driver.cxx b/cli-tests/merge/driver.cxx
index 0420442..43b1c59 100644
--- a/tests/merge/driver.cxx
+++ b/cli-tests/merge/driver.cxx
@@ -1,4 +1,4 @@
-// file : tests/merge/driver.cxx
+// file : merge/driver.cxx
// author : Boris Kolpackov <boris@codesynthesis.com>
// license : MIT; see accompanying LICENSE file
diff --git a/tests/merge/test.cli b/cli-tests/merge/test.cli
index 4c61f6a..67f50c6 100644
--- a/tests/merge/test.cli
+++ b/cli-tests/merge/test.cli
@@ -1,4 +1,4 @@
-// file : tests/merge/test.cli
+// file : merge/test.cli
// author : Boris Kolpackov <boris@codesynthesis.com>
// license : MIT; see accompanying LICENSE file
diff --git a/cli-tests/note/buildfile b/cli-tests/note/buildfile
new file mode 100644
index 0000000..c8cf49b
--- /dev/null
+++ b/cli-tests/note/buildfile
@@ -0,0 +1,6 @@
+# file : note/buildfile
+# license : MIT; see accompanying LICENSE file
+
+./: testscript $cli
+
+testscript{*}: test = $cli
diff --git a/tests/note/testscript b/cli-tests/note/testscript
index 0646d79..9f00811 100644
--- a/tests/note/testscript
+++ b/cli-tests/note/testscript
@@ -1,8 +1,6 @@
-# file : tests/note/testscript
+# file : note/testscript
# license : MIT; see accompanying LICENSE file
-test = $effect($cli.path)
-
: block-basics
:
cat <<EOI >=test.cli;
diff --git a/tests/specifier/buildfile b/cli-tests/specifier/buildfile
index 3a0e42e..935a002 100644
--- a/tests/specifier/buildfile
+++ b/cli-tests/specifier/buildfile
@@ -1,4 +1,4 @@
-# file : tests/specifier/buildfile
+# file : specifier/buildfile
# license : MIT; see accompanying LICENSE file
exe{driver}: {hxx cxx}{* -test} cli.cxx{test}
diff --git a/tests/specifier/driver.cxx b/cli-tests/specifier/driver.cxx
index 0194bbe..50b9cf5 100644
--- a/tests/specifier/driver.cxx
+++ b/cli-tests/specifier/driver.cxx
@@ -1,4 +1,4 @@
-// file : tests/specifier/driver.cxx
+// file : specifier/driver.cxx
// author : Boris Kolpackov <boris@codesynthesis.com>
// license : MIT; see accompanying LICENSE file
diff --git a/tests/specifier/test.cli b/cli-tests/specifier/test.cli
index f8fdf96..c11ebb7 100644
--- a/tests/specifier/test.cli
+++ b/cli-tests/specifier/test.cli
@@ -1,4 +1,4 @@
-// file : tests/specifier/test.cli
+// file : specifier/test.cli
// author : Boris Kolpackov <boris@codesynthesis.com>
// license : MIT; see accompanying LICENSE file
diff --git a/cli-tests/toc/buildfile b/cli-tests/toc/buildfile
new file mode 100644
index 0000000..3be6359
--- /dev/null
+++ b/cli-tests/toc/buildfile
@@ -0,0 +1,6 @@
+# file : toc/buildfile
+# license : MIT; see accompanying LICENSE file
+
+./: testscript $cli
+
+testscript{*}: test = $cli
diff --git a/tests/toc/testscript b/cli-tests/toc/testscript
index 4192a7e..70e9065 100644
--- a/tests/toc/testscript
+++ b/cli-tests/toc/testscript
@@ -1,8 +1,6 @@
-# file : tests/toc/testscript
+# file : toc/testscript
# license : MIT; see accompanying LICENSE file
-test = $effect($cli.path)
-
: toc
:
cat <<EOI >=toc.cli;
diff --git a/cli/.gitignore b/cli/.gitignore
index bb4f521..cece09c 100644
--- a/cli/.gitignore
+++ b/cli/.gitignore
@@ -1,2 +1,19 @@
-cli
-version.hxx
+# Compiler/linker output.
+#
+*.d
+*.t
+*.i
+*.ii
+*.o
+*.obj
+*.so
+*.dll
+*.a
+*.lib
+*.exp
+*.pdb
+*.ilk
+*.exe
+*.exe.dlls/
+*.exe.manifest
+*.pc
diff --git a/cli/INSTALL b/cli/INSTALL
new file mode 100644
index 0000000..abb0f51
--- /dev/null
+++ b/cli/INSTALL
@@ -0,0 +1,6 @@
+The easiest way to build this package is with the bpkg package manager:
+
+$ bpkg build cli
+
+But if you don't want to use the package manager, then you can also build it
+manually using the standard build2 build system.
diff --git a/cli/LICENSE b/cli/LICENSE
new file mode 120000
index 0000000..ea5b606
--- /dev/null
+++ b/cli/LICENSE
@@ -0,0 +1 @@
+../LICENSE \ No newline at end of file
diff --git a/NEWS b/cli/NEWS
index a1fe25e..a1fe25e 100644
--- a/NEWS
+++ b/cli/NEWS
diff --git a/README b/cli/README
index d2c6a02..d2c6a02 100644
--- a/README
+++ b/cli/README
diff --git a/build/.gitignore b/cli/build/.gitignore
index e931f20..e931f20 100644
--- a/build/.gitignore
+++ b/cli/build/.gitignore
diff --git a/cli/build/bootstrap.build b/cli/build/bootstrap.build
new file mode 100644
index 0000000..1e5c8a4
--- /dev/null
+++ b/cli/build/bootstrap.build
@@ -0,0 +1,10 @@
+# file : build/bootstrap.build
+# license : MIT; see accompanying LICENSE file
+
+project = cli
+
+using version
+using config
+using dist
+using test
+using install
diff --git a/build/export.build b/cli/build/export.build
index 92c546c..92c546c 100644
--- a/build/export.build
+++ b/cli/build/export.build
diff --git a/cli/build/root.build b/cli/build/root.build
new file mode 100644
index 0000000..c611c4f
--- /dev/null
+++ b/cli/build/root.build
@@ -0,0 +1,60 @@
+# file : build/root.build
+# license : MIT; see accompanying LICENSE file
+
+# Regenerate the options parsing code (included into the repository).
+#
+# Note that this is the same variable as what's used by the import machinery
+# when we import cli%exe{cli}. Here, however, we require it to be explicitly
+# specified (i.e., no default search in PATH) in order for the regeneration
+# to be enabled.
+#
+# Normally, in the development build, this variable will be set only in the
+# cli package configuration to point to its own binary (or a binary in another
+# build configuration if you want to play it safe).
+#
+# Note, though, that currently referring to the cli target in the project
+# itself ends up with the 'dependency cycle detected' error. In the future we
+# will fix that by using an ad hoc recipe instead of the cli module. But for
+# now you can workaround this issue by pointing to a binary in another
+# configuration.
+#
+config [path] config.cli
+
+cxx.std = latest
+
+using cxx
+
+hxx{*}: extension = hxx
+ixx{*}: extension = ixx
+txx{*}: extension = txx
+cxx{*}: extension = cxx
+
+if ($cxx.target.system == 'win32-msvc')
+ cxx.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
+
+if ($cxx.class == 'msvc')
+ cxx.coptions += /wd4251 /wd4275 /wd4800
+
+cxx.poptions =+ "-I$out_root" "-I$src_root"
+
+# Load the cli module only if explicitly requested. This way a distribution
+# that includes pre-generated files can be built without installing cli. This
+# is also the reason why we need to explicitly spell out individual source
+# file prerequisites instead of using the cli.cxx{} group (it won't be there
+# unless the module is configured).
+#
+# @@ Replace with import when the parsing code regenerating is implemented
+# via an ad hoc recipe.
+#
+if ($config.cli != [null] && $config.cli != false)
+ using cli
+
+# All exe{} in unit-tests/ are, well, tests. Also don't link whole archives
+# by default there.
+#
+unit-tests/exe{*}: test = true
+unit-tests/{libue libul}{*}: bin.whole = false
+
+# Specify the test target for cross-testing.
+#
+test.target = $cxx.target
diff --git a/cli/buildfile b/cli/buildfile
index d6723d0..832328a 100644
--- a/cli/buildfile
+++ b/cli/buildfile
@@ -1,54 +1,9 @@
-# file : cli/buildfile
+# file : buildfile
# license : MIT; see accompanying LICENSE file
-import libs = libcutl%lib{cutl}
+./: {*/ -build/} doc{INSTALL LICENSE NEWS README} manifest
-exe{cli}: cxx{cli} libue{cli}
-{
- # Target metadata, see also --build2-metadata in cli.cxx.
- #
- cli.version = $version.project_id
- cli.checksum = $version
-}
-
-libue{cli}: {hxx ixx txx cxx}{** -cli -version -options} \
- {hxx}{version} {hxx ixx cxx}{options} \
- $libs
-
-hxx{version}: in{version} $src_root/manifest
-
-# Build options.
-#
-# Pass the copyright notice extracted from the LICENSE file.
-#
-copyright = $process.run_regex(cat $src_root/LICENSE, \
- 'Copyright \(c\) (.+)\.', \
- '\1')
-
-obj{cli}: cxx.poptions += -DCLI_COPYRIGHT=\"$copyright\"
-
-# Generated options parser.
+# Don't install unit tests or the INSTALL file.
#
-if $cli.configured
-{
- cli.cxx{options}: cli{options}
-
- cli.options += --include-with-brackets --include-prefix cli \
---guard-prefix CLI --generate-file-scanner --generate-specifier \
---generate-modifier --reserved-name stdout
-
- cli.cxx{*}:
- {
- # Include the generated cli files into the distribution and don't remove
- # them when cleaning in src (so that clean results in a state identical to
- # distributed).
- #
- dist = true
- clean = ($src_root != $out_root)
-
- # We keep the generated code in the repository so copy it back to src
- # in case of a forwarded configuration.
- #
- backlink = overwrite
- }
-}
+unit-tests/: install = false
+doc{INSTALL}@./: install = false
diff --git a/cli/cli/.gitignore b/cli/cli/.gitignore
new file mode 100644
index 0000000..903d015
--- /dev/null
+++ b/cli/cli/.gitignore
@@ -0,0 +1,7 @@
+cli
+version.hxx
+
+# Unit test executables and Testscript output directories (can be symlinks).
+#
+*.test
+test-*.test
diff --git a/cli/cli/buildfile b/cli/cli/buildfile
new file mode 100644
index 0000000..ff562c2
--- /dev/null
+++ b/cli/cli/buildfile
@@ -0,0 +1,75 @@
+# file : cli/buildfile
+# license : MIT; see accompanying LICENSE file
+
+import libs = libcutl%lib{cutl}
+
+./: exe{cli}: cxx{cli} libue{cli}
+
+# Target metadata, see also --build2-metadata in cli.cxx.
+#
+exe{cli}:
+{
+ cli.version = $version.project_id
+ cli.checksum = $version
+}
+
+libue{cli}: {hxx ixx txx cxx}{** -cli -version -options -**.test...} \
+ {hxx}{version} {hxx ixx cxx}{options} \
+ $libs
+
+hxx{version}: in{version} $src_root/manifest
+
+# Unit tests.
+#
+exe{*.test}:
+{
+ test = true
+ install = false
+}
+
+for t: cxx{**.test...}
+{
+ d = $directory($t)
+ n = $name($t)...
+
+ ./: $d/exe{$n}: $t $d/{hxx ixx txx}{+$n} $d/testscript{+$n}
+ $d/exe{$n}: libue{cli}: bin.whole = false
+}
+
+# Build options.
+#
+# Pass the copyright notice extracted from the LICENSE file.
+#
+copyright = $process.run_regex(cat $src_root/LICENSE, \
+ 'Copyright \(c\) (.+)\.', \
+ '\1')
+
+obj{cli}: cxx.poptions += -DCLI_COPYRIGHT=\"$copyright\"
+
+# Generated options parsing code.
+#
+# @@ This will eventually be replaced with an ah hoc recipe.
+#
+if ($config.cli != [null] && $config.cli != false)
+{
+ cli.cxx{options}: cli{options}
+
+ cli.options += --include-with-brackets --include-prefix cli \
+--guard-prefix CLI --generate-file-scanner --generate-specifier \
+--generate-modifier --reserved-name stdout
+
+ cli.cxx{*}:
+ {
+ # Include the generated cli files into the distribution and don't remove
+ # them when cleaning in src (so that clean results in a state identical to
+ # distributed).
+ #
+ dist = true
+ clean = ($src_root != $out_root)
+
+ # We keep the generated code in the repository so copy it back to src
+ # in case of a forwarded configuration.
+ #
+ backlink = overwrite
+ }
+}
diff --git a/cli/cli.cxx b/cli/cli/cli.cxx
index c57caee..c57caee 100644
--- a/cli/cli.cxx
+++ b/cli/cli/cli.cxx
diff --git a/cli/context.cxx b/cli/cli/context.cxx
index 54bb988..54bb988 100644
--- a/cli/context.cxx
+++ b/cli/cli/context.cxx
diff --git a/cli/context.hxx b/cli/cli/context.hxx
index 633b8ad..633b8ad 100644
--- a/cli/context.hxx
+++ b/cli/cli/context.hxx
diff --git a/cli/generator.cxx b/cli/cli/generator.cxx
index df1b99e..df1b99e 100644
--- a/cli/generator.cxx
+++ b/cli/cli/generator.cxx
diff --git a/cli/generator.hxx b/cli/cli/generator.hxx
index f567528..f567528 100644
--- a/cli/generator.hxx
+++ b/cli/cli/generator.hxx
diff --git a/cli/header.cxx b/cli/cli/header.cxx
index a2a3ccd..a2a3ccd 100644
--- a/cli/header.cxx
+++ b/cli/cli/header.cxx
diff --git a/cli/header.hxx b/cli/cli/header.hxx
index e6e68ee..e6e68ee 100644
--- a/cli/header.hxx
+++ b/cli/cli/header.hxx
diff --git a/cli/html.cxx b/cli/cli/html.cxx
index b374b91..b374b91 100644
--- a/cli/html.cxx
+++ b/cli/cli/html.cxx
diff --git a/cli/html.hxx b/cli/cli/html.hxx
index 4ba5a41..4ba5a41 100644
--- a/cli/html.hxx
+++ b/cli/cli/html.hxx
diff --git a/cli/inline.cxx b/cli/cli/inline.cxx
index 05b83db..05b83db 100644
--- a/cli/inline.cxx
+++ b/cli/cli/inline.cxx
diff --git a/cli/inline.hxx b/cli/cli/inline.hxx
index 38e7768..38e7768 100644
--- a/cli/inline.hxx
+++ b/cli/cli/inline.hxx
diff --git a/cli/lexer.cxx b/cli/cli/lexer.cxx
index 573c76b..573c76b 100644
--- a/cli/lexer.cxx
+++ b/cli/cli/lexer.cxx
diff --git a/cli/lexer.hxx b/cli/cli/lexer.hxx
index bd7b0c9..bd7b0c9 100644
--- a/cli/lexer.hxx
+++ b/cli/cli/lexer.hxx
diff --git a/cli/lexer.ixx b/cli/cli/lexer.ixx
index 1c4c42e..1c4c42e 100644
--- a/cli/lexer.ixx
+++ b/cli/cli/lexer.ixx
diff --git a/unit-tests/lexer/driver.cxx b/cli/cli/lexer.test.cxx
index f65bd2f..0eb4dcb 100644
--- a/unit-tests/lexer/driver.cxx
+++ b/cli/cli/lexer.test.cxx
@@ -1,4 +1,4 @@
-// file : unit-tests/lexer/driver.cxx
+// file : cli/lexer.test.cxx
// author : Boris Kolpackov <boris@codesynthesis.com>
// license : MIT; see accompanying LICENSE file
diff --git a/unit-tests/lexer/testscript b/cli/cli/lexer.test.testscript
index f001f54..e2df5f6 100644
--- a/unit-tests/lexer/testscript
+++ b/cli/cli/lexer.test.testscript
@@ -1,4 +1,4 @@
-# file : unit-tests/lexer/testscript
+# file : cli/lexer.test.testscript
# license : MIT; see accompanying LICENSE file
# @@ Give tests some meaningfull descriptions.
diff --git a/cli/man.cxx b/cli/cli/man.cxx
index df703e8..df703e8 100644
--- a/cli/man.cxx
+++ b/cli/cli/man.cxx
diff --git a/cli/man.hxx b/cli/cli/man.hxx
index 0825305..0825305 100644
--- a/cli/man.hxx
+++ b/cli/cli/man.hxx
diff --git a/cli/name-processor.cxx b/cli/cli/name-processor.cxx
index ab125bc..ab125bc 100644
--- a/cli/name-processor.cxx
+++ b/cli/cli/name-processor.cxx
diff --git a/cli/name-processor.hxx b/cli/cli/name-processor.hxx
index c21561b..c21561b 100644
--- a/cli/name-processor.hxx
+++ b/cli/cli/name-processor.hxx
diff --git a/cli/option-types.cxx b/cli/cli/option-types.cxx
index da1f434..da1f434 100644
--- a/cli/option-types.cxx
+++ b/cli/cli/option-types.cxx
diff --git a/cli/option-types.hxx b/cli/cli/option-types.hxx
index 02d9ede..02d9ede 100644
--- a/cli/option-types.hxx
+++ b/cli/cli/option-types.hxx
diff --git a/cli/options.cli b/cli/cli/options.cli
index e564bc4..e564bc4 100644
--- a/cli/options.cli
+++ b/cli/cli/options.cli
diff --git a/cli/options.cxx b/cli/cli/options.cxx
index cc22a35..cc22a35 100644
--- a/cli/options.cxx
+++ b/cli/cli/options.cxx
diff --git a/cli/options.hxx b/cli/cli/options.hxx
index b253092..b253092 100644
--- a/cli/options.hxx
+++ b/cli/cli/options.hxx
diff --git a/cli/options.ixx b/cli/cli/options.ixx
index 12d40db..12d40db 100644
--- a/cli/options.ixx
+++ b/cli/cli/options.ixx
diff --git a/cli/parser.cxx b/cli/cli/parser.cxx
index 4685edc..4685edc 100644
--- a/cli/parser.cxx
+++ b/cli/cli/parser.cxx
diff --git a/cli/parser.hxx b/cli/cli/parser.hxx
index 326768e..326768e 100644
--- a/cli/parser.hxx
+++ b/cli/cli/parser.hxx
diff --git a/unit-tests/parser/driver.cxx b/cli/cli/parser.test.cxx
index 3e16b22..6ef0d11 100644
--- a/unit-tests/parser/driver.cxx
+++ b/cli/cli/parser.test.cxx
@@ -1,4 +1,4 @@
-// file : unit-tests/parser/driver.cxx
+// file : cli/parser.test.cxx
// author : Boris Kolpackov <boris@codesynthesis.com>
// license : MIT; see accompanying LICENSE file
diff --git a/unit-tests/parser/testscript b/cli/cli/parser.test.testscript
index 5e10add..9522dbe 100644
--- a/unit-tests/parser/testscript
+++ b/cli/cli/parser.test.testscript
@@ -1,4 +1,4 @@
-# file : unit-tests/parser/testscript
+# file : cli/parser.test.testscript
# license : MIT; see accompanying LICENSE file
# @@ Give tests some meaningfull descriptions. Probably move c++-style comments
diff --git a/cli/runtime-header.cxx b/cli/cli/runtime-header.cxx
index adf70dd..adf70dd 100644
--- a/cli/runtime-header.cxx
+++ b/cli/cli/runtime-header.cxx
diff --git a/cli/runtime-header.hxx b/cli/cli/runtime-header.hxx
index f4bff7c..f4bff7c 100644
--- a/cli/runtime-header.hxx
+++ b/cli/cli/runtime-header.hxx
diff --git a/cli/runtime-inline.cxx b/cli/cli/runtime-inline.cxx
index 8f0e84c..8f0e84c 100644
--- a/cli/runtime-inline.cxx
+++ b/cli/cli/runtime-inline.cxx
diff --git a/cli/runtime-inline.hxx b/cli/cli/runtime-inline.hxx
index 045c060..045c060 100644
--- a/cli/runtime-inline.hxx
+++ b/cli/cli/runtime-inline.hxx
diff --git a/cli/runtime-source.cxx b/cli/cli/runtime-source.cxx
index 36d8968..36d8968 100644
--- a/cli/runtime-source.cxx
+++ b/cli/cli/runtime-source.cxx
diff --git a/cli/runtime-source.hxx b/cli/cli/runtime-source.hxx
index 0e51c4b..0e51c4b 100644
--- a/cli/runtime-source.hxx
+++ b/cli/cli/runtime-source.hxx
diff --git a/cli/semantics.hxx b/cli/cli/semantics.hxx
index 4b18629..4b18629 100644
--- a/cli/semantics.hxx
+++ b/cli/cli/semantics.hxx
diff --git a/cli/semantics/class.cxx b/cli/cli/semantics/class.cxx
index 494d5d0..494d5d0 100644
--- a/cli/semantics/class.cxx
+++ b/cli/cli/semantics/class.cxx
diff --git a/cli/semantics/class.hxx b/cli/cli/semantics/class.hxx
index ca7de8c..ca7de8c 100644
--- a/cli/semantics/class.hxx
+++ b/cli/cli/semantics/class.hxx
diff --git a/cli/semantics/doc.cxx b/cli/cli/semantics/doc.cxx
index c31260c..c31260c 100644
--- a/cli/semantics/doc.cxx
+++ b/cli/cli/semantics/doc.cxx
diff --git a/cli/semantics/doc.hxx b/cli/cli/semantics/doc.hxx
index 8dacb7a..8dacb7a 100644
--- a/cli/semantics/doc.hxx
+++ b/cli/cli/semantics/doc.hxx
diff --git a/cli/semantics/elements.cxx b/cli/cli/semantics/elements.cxx
index ed8eb7d..ed8eb7d 100644
--- a/cli/semantics/elements.cxx
+++ b/cli/cli/semantics/elements.cxx
diff --git a/cli/semantics/elements.hxx b/cli/cli/semantics/elements.hxx
index 6235a06..6235a06 100644
--- a/cli/semantics/elements.hxx
+++ b/cli/cli/semantics/elements.hxx
diff --git a/cli/semantics/expression.cxx b/cli/cli/semantics/expression.cxx
index 18d3312..18d3312 100644
--- a/cli/semantics/expression.cxx
+++ b/cli/cli/semantics/expression.cxx
diff --git a/cli/semantics/expression.hxx b/cli/cli/semantics/expression.hxx
index e36a0cb..e36a0cb 100644
--- a/cli/semantics/expression.hxx
+++ b/cli/cli/semantics/expression.hxx
diff --git a/cli/semantics/namespace.cxx b/cli/cli/semantics/namespace.cxx
index 3c2643c..3c2643c 100644
--- a/cli/semantics/namespace.cxx
+++ b/cli/cli/semantics/namespace.cxx
diff --git a/cli/semantics/namespace.hxx b/cli/cli/semantics/namespace.hxx
index 00c7bfc..00c7bfc 100644
--- a/cli/semantics/namespace.hxx
+++ b/cli/cli/semantics/namespace.hxx
diff --git a/cli/semantics/option.cxx b/cli/cli/semantics/option.cxx
index 8746a5e..8746a5e 100644
--- a/cli/semantics/option.cxx
+++ b/cli/cli/semantics/option.cxx
diff --git a/cli/semantics/option.hxx b/cli/cli/semantics/option.hxx
index a9bb963..a9bb963 100644
--- a/cli/semantics/option.hxx
+++ b/cli/cli/semantics/option.hxx
diff --git a/cli/semantics/unit.cxx b/cli/cli/semantics/unit.cxx
index 9c532ea..9c532ea 100644
--- a/cli/semantics/unit.cxx
+++ b/cli/cli/semantics/unit.cxx
diff --git a/cli/semantics/unit.hxx b/cli/cli/semantics/unit.hxx
index e37648a..e37648a 100644
--- a/cli/semantics/unit.hxx
+++ b/cli/cli/semantics/unit.hxx
diff --git a/cli/semantics/unit.txx b/cli/cli/semantics/unit.txx
index 99d178f..99d178f 100644
--- a/cli/semantics/unit.txx
+++ b/cli/cli/semantics/unit.txx
diff --git a/cli/source.cxx b/cli/cli/source.cxx
index 9cd2382..9cd2382 100644
--- a/cli/source.cxx
+++ b/cli/cli/source.cxx
diff --git a/cli/source.hxx b/cli/cli/source.hxx
index b27cf76..b27cf76 100644
--- a/cli/source.hxx
+++ b/cli/cli/source.hxx
diff --git a/cli/token.hxx b/cli/cli/token.hxx
index 7045826..7045826 100644
--- a/cli/token.hxx
+++ b/cli/cli/token.hxx
diff --git a/cli/token.ixx b/cli/cli/token.ixx
index 77ab225..77ab225 100644
--- a/cli/token.ixx
+++ b/cli/cli/token.ixx
diff --git a/cli/traversal.hxx b/cli/cli/traversal.hxx
index 1961f7b..1961f7b 100644
--- a/cli/traversal.hxx
+++ b/cli/cli/traversal.hxx
diff --git a/cli/traversal/class.cxx b/cli/cli/traversal/class.cxx
index b920f1f..b920f1f 100644
--- a/cli/traversal/class.cxx
+++ b/cli/cli/traversal/class.cxx
diff --git a/cli/traversal/class.hxx b/cli/cli/traversal/class.hxx
index 38cbefc..38cbefc 100644
--- a/cli/traversal/class.hxx
+++ b/cli/cli/traversal/class.hxx
diff --git a/cli/traversal/doc.hxx b/cli/cli/traversal/doc.hxx
index 70a6dfd..70a6dfd 100644
--- a/cli/traversal/doc.hxx
+++ b/cli/cli/traversal/doc.hxx
diff --git a/cli/traversal/elements.cxx b/cli/cli/traversal/elements.cxx
index f3353f2..f3353f2 100644
--- a/cli/traversal/elements.cxx
+++ b/cli/cli/traversal/elements.cxx
diff --git a/cli/traversal/elements.hxx b/cli/cli/traversal/elements.hxx
index a2ada23..a2ada23 100644
--- a/cli/traversal/elements.hxx
+++ b/cli/cli/traversal/elements.hxx
diff --git a/cli/traversal/expression.hxx b/cli/cli/traversal/expression.hxx
index 0888455..0888455 100644
--- a/cli/traversal/expression.hxx
+++ b/cli/cli/traversal/expression.hxx
diff --git a/cli/traversal/namespace.cxx b/cli/cli/traversal/namespace.cxx
index c938f77..c938f77 100644
--- a/cli/traversal/namespace.cxx
+++ b/cli/cli/traversal/namespace.cxx
diff --git a/cli/traversal/namespace.hxx b/cli/cli/traversal/namespace.hxx
index 5709f2a..5709f2a 100644
--- a/cli/traversal/namespace.hxx
+++ b/cli/cli/traversal/namespace.hxx
diff --git a/cli/traversal/option.cxx b/cli/cli/traversal/option.cxx
index ff5dcce..ff5dcce 100644
--- a/cli/traversal/option.cxx
+++ b/cli/cli/traversal/option.cxx
diff --git a/cli/traversal/option.hxx b/cli/cli/traversal/option.hxx
index e11fa21..e11fa21 100644
--- a/cli/traversal/option.hxx
+++ b/cli/cli/traversal/option.hxx
diff --git a/cli/traversal/unit.cxx b/cli/cli/traversal/unit.cxx
index cf10d1d..cf10d1d 100644
--- a/cli/traversal/unit.cxx
+++ b/cli/cli/traversal/unit.cxx
diff --git a/cli/traversal/unit.hxx b/cli/cli/traversal/unit.hxx
index eab42aa..eab42aa 100644
--- a/cli/traversal/unit.hxx
+++ b/cli/cli/traversal/unit.hxx
diff --git a/cli/txt.cxx b/cli/cli/txt.cxx
index 16de45a..16de45a 100644
--- a/cli/txt.cxx
+++ b/cli/cli/txt.cxx
diff --git a/cli/txt.hxx b/cli/cli/txt.hxx
index cde31c9..cde31c9 100644
--- a/cli/txt.hxx
+++ b/cli/cli/txt.hxx
diff --git a/cli/version.hxx.in b/cli/cli/version.hxx.in
index 90b649a..90b649a 100644
--- a/cli/version.hxx.in
+++ b/cli/cli/version.hxx.in
diff --git a/cli/doc/.gitignore b/cli/doc/.gitignore
new file mode 100644
index 0000000..562ecbd
--- /dev/null
+++ b/cli/doc/.gitignore
@@ -0,0 +1,2 @@
+cli.xhtml
+cli.1
diff --git a/cli/doc/buildfile b/cli/doc/buildfile
new file mode 100644
index 0000000..f47adad
--- /dev/null
+++ b/cli/doc/buildfile
@@ -0,0 +1,20 @@
+# file : doc/buildfile
+# license : MIT; see accompanying LICENSE file
+
+define css: doc
+css{*}: extension = css
+
+define xhtml: doc
+xhtml{*}: extension = xhtml
+
+./: {man1 xhtml}{cli} \
+ css{default} \
+ file{cli-*}
+
+./: guide/doc{cli-guide*} \
+ guide/xhtml{index} \
+ guide/file{*.html2ps}
+
+doc{*}: install.subdirs = true
+
+./: file{doc.sh}
diff --git a/doc/cli-epilogue.1 b/cli/doc/cli-epilogue.1
index 5e2ffae..5e2ffae 100644
--- a/doc/cli-epilogue.1
+++ b/cli/doc/cli-epilogue.1
diff --git a/doc/cli-epilogue.xhtml b/cli/doc/cli-epilogue.xhtml
index 8a70d81..8a70d81 100644
--- a/doc/cli-epilogue.xhtml
+++ b/cli/doc/cli-epilogue.xhtml
diff --git a/doc/cli-prologue.1 b/cli/doc/cli-prologue.1
index 165cd1a..165cd1a 100644
--- a/doc/cli-prologue.1
+++ b/cli/doc/cli-prologue.1
diff --git a/doc/cli-prologue.xhtml b/cli/doc/cli-prologue.xhtml
index 9a57f0e..9a57f0e 100644
--- a/doc/cli-prologue.xhtml
+++ b/cli/doc/cli-prologue.xhtml
diff --git a/doc/default.css b/cli/doc/default.css
index c73bb8d..c73bb8d 100644
--- a/doc/default.css
+++ b/cli/doc/default.css
diff --git a/doc/doc.sh b/cli/doc/doc.sh
index df577cc..dde9aca 100755
--- a/doc/doc.sh
+++ b/cli/doc/doc.sh
@@ -38,7 +38,7 @@ function compile () # <input-name> <output-name>
done
# --html-suffix .xhtml
- cli -I .. \
+ ../cli/cli -I .. \
-v project="cli" \
-v version="$version" \
-v date="$date" \
@@ -49,7 +49,7 @@ function compile () # <input-name> <output-name>
"../cli/$i.cli" >"$o.xhtml"
# --man-suffix .1
- cli -I .. \
+ ../cli/cli -I .. \
-v project="cli" \
-v version="$version" \
-v date="$date" \
diff --git a/doc/guide/.gitignore b/cli/doc/guide/.gitignore
index 239cc7f..239cc7f 100644
--- a/doc/guide/.gitignore
+++ b/cli/doc/guide/.gitignore
diff --git a/doc/guide/guide.html2ps b/cli/doc/guide/guide.html2ps
index a691002..a691002 100644
--- a/doc/guide/guide.html2ps
+++ b/cli/doc/guide/guide.html2ps
diff --git a/doc/guide/index.xhtml b/cli/doc/guide/index.xhtml
index 675db03..675db03 100644
--- a/doc/guide/index.xhtml
+++ b/cli/doc/guide/index.xhtml
diff --git a/doc/language.txt b/cli/doc/language.txt
index e6c9161..e6c9161 100644
--- a/doc/language.txt
+++ b/cli/doc/language.txt
diff --git a/manifest b/cli/manifest
index 1330844..69c113b 100644
--- a/manifest
+++ b/cli/manifest
@@ -9,11 +9,13 @@ description-file: README
changes-file: NEWS
url: https://www.codesynthesis.com/projects/cli/
doc-url: https://www.codesynthesis.com/projects/cli/doc/guide/
-src-url: https://git.codesynthesis.com/cgit/cli/cli/
+src-url: https://git.codesynthesis.com/cgit/cli/cli/tree/cli
email: cli-users@codesynthesis.com ; Mailing list
build-email: builds@codesynthesis.com
builds: all
requires: c++14
-depends: * build2 >= 0.12.0-
-depends: * bpkg >= 0.12.0-
+depends: * build2 >= 0.13.0-
+depends: * bpkg >= 0.13.0-
depends: libcutl ^1.11.0-
+tests: cli-tests == $
+examples: cli-examples == $
diff --git a/doc/cli.1 b/doc/cli.1
deleted file mode 100644
index 6b64f9e..0000000
--- a/doc/cli.1
+++ /dev/null
@@ -1,412 +0,0 @@
-.\" Process this file with
-.\" groff -man -Tascii cli.1
-.\"
-.TH CLI 1 "December 2009" "CLI 1.2.0"
-.SH NAME
-cli \- command line interface compiler for C++
-.\"
-.\"
-.\"
-.\"--------------------------------------------------------------------
-.SH SYNOPSIS
-.\"--------------------------------------------------------------------
-.B cli
-.B [
-.I options
-.B ]
-.I file
-.\"
-.\"
-.\"
-.\"--------------------------------------------------------------------
-.SH DESCRIPTION
-.\"--------------------------------------------------------------------
-.B cli
-generates C++ implementation and documentation in various formats for a
-command line interface defined in the CLI language. For an input file in
-the form
-.B name.cli
-the following is generated. By default or if the
-.B --generate-cxx
-option is specified, the following C++ files are generated:
-.B name.hxx
-(header file),
-.B name.ixx
-(inline file, generated unless the
-.B --suppress-inline
-option is specified), and
-.B name.cxx (source file).
-If the
-.B --generate-html
-option is specified, then the
-.B name.html
-HTML documentation file is generated. If the
-.B --generate-man
-option is specified, then the
-.B name.1
-man page file is generated. When
-.B --generate-html
-or
-.B --generate-man
-is specified, the
-.B --stdout
-option can be used to redirect the output to STDOUT instead of a file.
-.\"
-.\"
-.\"
-.\"--------------------------------------------------------------------
-.SH OPTIONS
-.\"--------------------------------------------------------------------
-.IP "\fB--help\fR"
-Print usage information and exit\.
-.IP "\fB--version\fR"
-Print version and exit\.
-.IP "\fB--include-path\fR|\fB-I\fR \fIdir\fR"
-Search \fIdir\fR for bracket-included (\fB<>\fR) options files\.
-.IP "\fB--output-dir\fR|\fB-o\fR \fIdir\fR"
-Write the generated files to \fIdir\fR instead of the current directory\.
-.IP "\fB--std\fR \fIversion\fR"
-Specify the C++ standard that should be used during compilation\. Valid values
-are \fBc++98\fR (default), \fBc++11\fR, and \fBc++14\fR\.
-.IP "\fB--generate-modifier\fR"
-Generate option value modifiers in addition to accessors\.
-.IP "\fB--generate-specifier\fR"
-Generate functions for determining whether the option was specified on the
-command line\.
-.IP "\fB--generate-parse\fR"
-Generate \fBparse()\fR functions instead of parsing constructors\. This is
-primarily useful for being able to parse into an already initialized options
-class instance, for example, to implement option appending/overriding\.
-.IP "\fB--generate-merge\fR"
-Generate \fBmerge()\fR functions\. This is primarily useful for being able to
-merge several already parsed options class instances, for example, to
-implement option appending/overriding\. Note that this option forces
-\fB--generate-specifier\fR\.
-.IP "\fB--generate-description\fR"
-Generate the option description list that can be examined at runtime\.
-.IP "\fB--generate-file-scanner\fR"
-Generate the \fBargv_file_scanner\fR implementation\. This scanner is capable
-of reading command line arguments from the \fBargv\fR array as well as files
-specified with command line options\.
-.IP "\fB--generate-vector-scanner\fR"
-Generate the \fBvector_scanner\fR implementation\. This scanner is capable of
-reading command line arguments from \fBvector<string>\fR\.
-.IP "\fB--generate-group-scanner\fR"
-Generate the \fBgroup_scanner\fR implementation\. This scanner supports
-grouping of arguments (usually options) to apply only to a certain argument\.
-
-Groups can be specified before (leading) and/or after (trailing) the argument
-they apply to\. A leading group starts with '\fB{\fR' and ends with '\fB}+\fR'
-while a trailing group starts with '\fB+{\fR' and ends with '\fB}\fR'\. For
-example:
-
-.nf
-{ --foo --bar }+ arg # 'arg' with '--foo' '--bar'
-arg +{ fox=1 baz=2 } # 'arg' with 'fox=1' 'baz=2'
-.fi
-
-Multiple leading and/or trailing groups can be specified for the same
-argument\. For example:
-
-.nf
-{ -f }+ { -b }+ arg +{ f=1 } +{ b=2 } # 'arg' with '-f' 'b' 'f=1' 'b=2'
-.fi
-
-Note that the group applies to a single argument only\. For example:
-
-.nf
-{ --foo }+ arg1 arg2 +{ --bar } # 'arg1' with '--foo' and
- # 'arg2' with '--bar'
-.fi
-
-The group separators ('\fB{\fR', '\fB}+'\fR, etc) must be separate command
-line arguments\. In particular, they must not be adjacent either to the
-arguments inside the group nor to the argument they apply to\. All such cases
-will be treated as ordinary arguments\. For example:
-
-.nf
-{--foo}+ arg # '{--foo}+' \.\.\.
-arg+{ --foo } # 'arg+{' \.\.\.
-.fi
-
-If one of the group separators needs to be specified as an argument verbatim,
-then it must be escaped with '\fB\e\fR'\. For example:
-
-.nf
-} # error: unexpected group separator
-}x # '}x'
-\\} # '}'
-{ \\}+ }+ arg # 'arg' with '}+'
-.fi
-.IP "\fB--suppress-inline\fR"
-Generate all functions non-inline\. By default simple functions are made
-inline\. This option suppresses creation of the inline file\.
-.IP "\fB--suppress-cli\fR"
-Do not generate the CLI support types (scanners, parser, etc)\. Normally, the
-support types are generated unless another \fB\.cli\fR was included, in which
-case the support types are expected to be provided by its generated code\.
-.IP "\fB--cli-namespace\fR \fIns\fR"
-Generate the CLI support types in the \fIns\fR namespace (\fBcli\fR by
-default)\. The namespace can be nested, for example \fBdetails::cli\fR\. If
-the namespace is empty, then the support types are generated in the global
-namespace\.
-.IP "\fB--ostream-type\fR \fItype\fR"
-Output stream type instead of the default \fBstd::ostream\fR that should be
-used to print usage and exception information\.
-.IP "\fB--generate-cxx\fR"
-Generate C++ code\. If neither \fB--generate-man\fR, \fB--generate-html\fR,
-nor \fB--generate-txt\fR is specified, this mode is assumed by default\.
-.IP "\fB--generate-man\fR"
-Generate documentation in the man page format\.
-.IP "\fB--generate-html\fR"
-Generate documentation in the HTML format\.
-.IP "\fB--generate-txt\fR"
-Generate documentation in the plain text format, similar to usage\.
-.IP "\fB--stdout\fR"
-Write output to STDOUT instead of a file\. This option is not valid when
-generating C++ code and is normally used to combine generated documentation
-for several option classes in a single file\.
-.IP "\fB--suppress-undocumented\fR"
-Suppress the generation of documentation entries for undocumented options\.
-.IP "\fB--suppress-usage\fR"
-Suppress the generation of the usage printing code\.
-.IP "\fB--long-usage\fR"
-If no short documentation string is provided, use the complete long
-documentation string in usage\. By default, in this situation only the first
-sentence from the long string is used\.
-.IP "\fB--short-usage\fR"
-If specified together with \fB--long-usage\fR, generate both short and long
-usage versions\. In this mode, the long usage printing function is called
-\fBprint_long_usage()\fR and in its implementation the long documentation
-string is always used, even if the short version is provided\.
-.IP "\fB--page-usage\fR \fIname\fR"
-Generate the combined usage printing code for the entire page\. Specifically,
-this will include all the namespace-level documentation as well as usage for
-all the options classes printed in the order they are defined in the main
-translation unit (documentation/classes from included units are ignored except
-for base classes)\.
-
-The \fIname\fR argument is used as a prefix to form the name of the usage
-printing function\. It can include the namespace qualification as well as
-documentation variable expansion, for example:
-
-.nf
---page-usage print_ # print_usage() in global namespace
---page-usage app::print_ # print_usage() in app namespace
---page-usage print_$name$_ # print_foo_usage() if name is foo
-.fi
-
-If both \fB--long-usage\fR and \fB--short-usage\fR options are specified, then
-the long usage function has the \fB*long_usage()\fR suffix\.
-.IP "\fB--option-length\fR \fIlen\fR"
-Indent option descriptions \fIlen\fR characters when printing usage\. This is
-useful when you have multiple options classes, potentially in separate files,
-and would like their usage to have the same indentation level\.
-.IP "\fB--ansi-color\fR"
-Use ANSI color escape sequences when printing usage\. By "color" we really
-only mean the bold and underline modifiers\. Note that Windows console does
-not recognize ANSI escape sequences and will display them as garbage\.
-However, if you pipe such output through \fBless(1)\fR, it will display them
-correctly\.
-.IP "\fB--exclude-base\fR"
-Exclude base class information from usage and documentation\.
-.IP "\fB--include-base-last\fR"
-Include base class information after derived for usage and documentation\. By
-default, base classes are included first\.
-.IP "\fB--class-doc\fR \fIname\fR=\fIkind\fR"
-Specify the documentation \fIkind\fR that should be used for the options class
-\fIname\fR\. The \fIname\fR value should be a fully-qualified class name, for
-example, \fBapp::options\fR\. The \fIkind\fR value can be \fBshort\fR,
-\fBlong\fR, \fBexclude\fR, or \fBexclude-base\fR\. If the value is
-\fBexclude\fR, then the class documentation is excluded from usage and
-man/HTML/text output\. If it is \fBexclude-base\fR, then it is only excluded
-when used as a base\. For usage, the \fBshort\fR and \fBlong\fR values
-determine which usage function will be called when the class is used as base
-or as part of the page usage (see \fB--page-usage\fR)\. For man/HTML/text,
-these values determine which documentation strings are used in the output\.
-.IP "\fB--class\fR \fIname\fR"
-Generate the man page, HTML, or text documentation only for the options class
-\fIname\fR\. The \fIname\fR value should be a fully-qualified options class
-name, for example, \fBapp::options\fR\. To generate documentation for multiple
-classes, repeat this option and the documentation will be produced in the
-order specified\. This functionality is useful if you need to assemble
-documentation from multiple classes in a specific order or to insert custom
-documentation between options belonging to different classes\.
-.IP "\fB--docvar\fR|\fB-v\fR \fIname\fR=\fIval\fR"
-Set documentation variable \fIname\fR to the value \fIval\fR\. Documentation
-variables can be substituted in prologues and epilogues (see
-\fB--*-prologue*\fR and \fB--*-epilogue*\fR options) using the
-\fB$\fR\fIname\fR\fB$\fR expansion syntax (use \fB$$\fR to escape expansion)\.
-They can also be defined in \fB\.cli\fR files using the
-\&"\e\fIname\fR=\fIval\fR"\fR syntax\.
-.IP "\fB--link-regex\fR \fIregex\fR"
-Add \fIregex\fR to the list of regular expressions used to transform link
-targets in the generated documentation\. The argument to this option is a
-Perl-like regular expression in the form
-\fB/\fR\fIpattern\fR\fB/\fR\fIreplacement\fR\fB/\fR\fR\. Any character can be
-used as a delimiter instead of '\fB/\fR' and the delimiter can be escaped
-inside \fIpattern\fR and \fIreplacement\fR with a backslash (\fB\e\fR)\. You
-can specify multiple regular expressions by repeating this option\. All the
-regular expressions are tried in the order specified and the first expression
-that matches is used\. Use the \fB--link-regex-trace\fR option to debug link
-transformation\.
-.IP "\fB--link-regex-trace\fR"
-Trace the process of applying regular expressions specified with the
-\fB--link-regex\fR option\. Use this option to find out why your regular
-expressions don't do what you expected them to do\.
-.IP "\fB--html-heading-map\fR \fIc\fR=\fIh\fR"
-Map CLI heading \fIc\fR (valid values: '\fBH\fR', '\fB0\fR', '\fB1\fR',
-\&'\fBh\fR', and '\fB2\fR') to HTML heading \fIh\fR (for example, '\fBh1\fR',
-\&'\fBh2\fR', etc)\.
-.IP "\fB--omit-link-check\fR"
-Don't check that local fragment link references (\el{#ref \.\.\.}) resolve to
-ids\.
-.IP "\fB--hxx-prologue\fR \fItext\fR"
-Insert \fItext\fR at the beginning of the generated C++ header file\.
-.IP "\fB--ixx-prologue\fR \fItext\fR"
-Insert \fItext\fR at the beginning of the generated C++ inline file\.
-.IP "\fB--cxx-prologue\fR \fItext\fR"
-Insert \fItext\fR at the beginning of the generated C++ source file\.
-.IP "\fB--man-prologue\fR \fItext\fR"
-Insert \fItext\fR at the beginning of the generated man page file\.
-.IP "\fB--html-prologue\fR \fItext\fR"
-Insert \fItext\fR at the beginning of the generated HTML file\.
-.IP "\fB--txt-prologue\fR \fItext\fR"
-Insert \fItext\fR at the beginning of the generated text file\.
-.IP "\fB--hxx-epilogue\fR \fItext\fR"
-Insert \fItext\fR at the end of the generated C++ header file\.
-.IP "\fB--ixx-epilogue\fR \fItext\fR"
-Insert \fItext\fR at the end of the generated C++ inline file\.
-.IP "\fB--cxx-epilogue\fR \fItext\fR"
-Insert \fItext\fR at the end of the generated C++ source file\.
-.IP "\fB--man-epilogue\fR \fItext\fR"
-Insert \fItext\fR at the end of the generated man page file\.
-.IP "\fB--html-epilogue\fR \fItext\fR"
-Insert \fItext\fR at the end of the generated HTML file\.
-.IP "\fB--txt-epilogue\fR \fItext\fR"
-Insert \fItext\fR at the end of the generated text file\.
-.IP "\fB--hxx-prologue-file\fR \fIfile\fR"
-Insert the content of \fIfile\fR at the beginning of the generated C++ header
-file\.
-.IP "\fB--ixx-prologue-file\fR \fIfile\fR"
-Insert the content of \fIfile\fR at the beginning of the generated C++ inline
-file\.
-.IP "\fB--cxx-prologue-file\fR \fIfile\fR"
-Insert the content of \fIfile\fR at the beginning of the generated C++ source
-file\.
-.IP "\fB--man-prologue-file\fR \fIfile\fR"
-Insert the content of \fIfile\fR at the beginning of the generated man page
-file\.
-.IP "\fB--html-prologue-file\fR \fIfile\fR"
-Insert the content of \fIfile\fR at the beginning of the generated HTML file\.
-.IP "\fB--txt-prologue-file\fR \fIfile\fR"
-Insert the content of \fIfile\fR at the beginning of the generated text file\.
-.IP "\fB--hxx-epilogue-file\fR \fIfile\fR"
-Insert the content of \fIfile\fR at the end of the generated C++ header file\.
-.IP "\fB--ixx-epilogue-file\fR \fIfile\fR"
-Insert the content of \fIfile\fR at the end of the generated C++ inline file\.
-.IP "\fB--cxx-epilogue-file\fR \fIfile\fR"
-Insert the content of \fIfile\fR at the end of the generated C++ source file\.
-.IP "\fB--man-epilogue-file\fR \fIfile\fR"
-Insert the content of \fIfile\fR at the end of the generated man page file\.
-.IP "\fB--html-epilogue-file\fR \fIfile\fR"
-Insert the content of \fIfile\fR at the end of the generated HTML file\.
-.IP "\fB--txt-epilogue-file\fR \fIfile\fR"
-Insert the content of \fIfile\fR at the end of the generated text file\.
-.IP "\fB--output-prefix\fR \fIprefix\fR"
-Add \fIprefix\fR at the beginning of the generated output file name(s)\.
-.IP "\fB--output-suffix\fR \fIsuffix\fR"
-Add \fIsuffix\fR at the end of the generated output file name(s)\. Note that
-it is added before any file type-specific suffixes; see \fB--*-suffix\fR
-below\.
-.IP "\fB--hxx-suffix\fR \fIsuffix\fR"
-Use \fIsuffix\fR instead of the default \fB\.hxx\fR to construct the name of
-the generated header file\.
-.IP "\fB--ixx-suffix\fR \fIsuffix\fR"
-Use \fIsuffix\fR instead of the default \fB\.ixx\fR to construct the name of
-the generated inline file\.
-.IP "\fB--cxx-suffix\fR \fIsuffix\fR"
-Use \fIsuffix\fR instead of the default \fB\.cxx\fR to construct the name of
-the generated source file\.
-.IP "\fB--man-suffix\fR \fIsuffix\fR"
-Use \fIsuffix\fR instead of the default \fB\.1\fR to construct the name of the
-generated man page file\.
-.IP "\fB--html-suffix\fR \fIsuffix\fR"
-Use \fIsuffix\fR instead of the default \fB\.html\fR to construct the name of
-the generated HTML file\.
-.IP "\fB--txt-suffix\fR \fIsuffix\fR"
-Use \fIsuffix\fR instead of the default \fB\.txt\fR to construct the name of
-the generated text file\.
-.IP "\fB--option-prefix\fR \fIprefix\fR"
-Use \fIprefix\fR instead of the default '\fB-\fR' as an option prefix\.
-Unknown command line arguments that start with this prefix are treated as
-unknown options\. If you set the option prefix to the empty value, then all
-the unknown command line arguments will be treated as program arguments\.
-.IP "\fB--option-separator\fR \fIsep\fR"
-Use \fIsep\fR instead of the default '\fB--\fR' as an optional separator
-between options and arguments\. All the command line arguments that are parsed
-after this separator are treated as program arguments\. Set the option
-separator to the empty value if you don't want this functionality\.
-.IP "\fB--keep-separator\fR"
-Leave the option separator in the scanner\. This is primarily useful for
-incremental option parsing\.
-.IP "\fB--no-combined-flags\fR"
-Disable support for combining multiple single-character flags into a single
-argument (the \fB-xyz\fR form that is equivalent to \fB-x\fR \fB-y\fR
-\fB-z\fR)\. An argument is considered a combination of flags if it starts with
-a single option prefix (\fB--option-prefix\fR) and only contains letters and
-digits\. Note that an option with a value may not be part of such a
-combination, not even if it is specified last\.
-.IP "\fB--no-combined-values\fR"
-Disable support for combining an option and its value into a single argument
-with the assignment sign (the \fIoption\fR\fB=\fR\fIvalue\fR\fR form)\. This
-functionality requires a non-empty option prefix (\fB--option-prefix\fR)\.
-.IP "\fB--include-with-brackets\fR"
-Use angle brackets (\fB<>\fR) instead of quotes (\fB""\fR) in the generated
-\fB#include\fR directives\.
-.IP "\fB--include-prefix\fR \fIprefix\fR"
-Add \fIprefix\fR to the generated \fB#include\fR directive paths\.
-.IP "\fB--guard-prefix\fR \fIprefix\fR"
-Add \fIprefix\fR to the generated header inclusion guards\. The prefix is
-transformed to upper case and characters that are illegal in a preprocessor
-macro name are replaced with underscores\.
-.IP "\fB--reserved-name\fR \fIname\fR=\fIrep\fR"
-Add \fIname\fR with an optional \fIrep\fR replacement to the list of names
-that should not be used as identifiers\. If provided, the replacement name is
-used instead\. All C++ keywords are already in this list\.
-.IP "\fB--options-file\fR \fIfile\fR"
-Read additional options from \fIfile\fR\. Each option should appear on a
-separate line optionally followed by space or equal sign (\fB=\fR) and an
-option value\. Empty lines and lines starting with \fB#\fR are ignored\.
-Option values can be enclosed in double (\fB"\fR) or single (\fB'\fR) quotes
-to preserve leading and trailing whitespaces as well as to specify empty
-values\. If the value itself contains trailing or leading quotes, enclose it
-with an extra pair of quotes, for example \fB'"x"'\fR\. Non-leading and
-non-trailing quotes are interpreted as being part of the option value\.
-
-The semantics of providing options in a file is equivalent to providing the
-same set of options in the same order on the command line at the point where
-the \fB--options-file\fR option is specified except that the shell escaping
-and quoting is not required\. Repeat this option to specify more than one
-options file\.
-.\"
-.\" DIAGNOSTICS
-.\"
-.SH DIAGNOSTICS
-If the input file is not a valid CLI definition,
-.B cli
-will issue diagnostic messages to STDERR and exit with non-zero exit code.
-.\"
-.\" BUGS
-.\"
-.SH BUGS
-Send bug reports to the cli-users@codesynthesis.com mailing list.
-.\"
-.\" COPYRIGHT
-.\"
-.SH COPYRIGHT
-Copyright (c) 2009-2020 Code Synthesis Tools CC.
-
-Permission is granted to copy, distribute and/or modify this document under
-the terms of the MIT License. Copy of this license can be obtained from
-http://www.codesynthesis.com/licenses/mit.txt
diff --git a/doc/cli.xhtml b/doc/cli.xhtml
deleted file mode 100644
index efd8337..0000000
--- a/doc/cli.xhtml
+++ /dev/null
@@ -1,568 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-
-<head>
- <title>CLI 1.2.0 Compiler Command Line Manual</title>
-
- <meta name="copyright" content="&#169; 2009-2020 Code Synthesis Tools CC"/>
- <meta name="keywords" content="cli,command,line,interface,compiler,c++"/>
- <meta name="description" content="CLI Compiler Command Line Manual"/>
-
- <link rel="stylesheet" type="text/css" href="default.css" />
-
-<style type="text/css">
-
- #synopsis {
- list-style-type: none;
- }
-
- #synopsis li {
- padding-top : 0.0em;
- padding-bottom : 0.0em;
- }
-
- .options {
- margin: 1em 0 1em 0;
- }
-
- .options dt {
- margin: 1em 0 0 0;
- }
-
- .options dd {
- margin: .1em 0 0 4.5em;
- }
-
-</style>
-</head>
-
-<body>
-<div id="container">
- <div id="content">
-
- <h1>NAME</h1>
-
- <p>cli - command line interface compiler for C++</p>
-
- <h1>SYNOPSIS</h1>
-
- <dl id="synopsis">
- <dt><code><b>cli</b> [<i>options</i>] <i>file</i></code></dt>
- </dl>
-
- <h1>DESCRIPTION</h1>
-
- <p><code><b>cli</b></code> generates C++ implementation and
- documentation in various formats for a command line interface
- defined in the CLI language. For an input file in the form
- <code><b>name.cli</b></code> the following is generated. By
- default or if the <code><b>--generate-cxx</b></code> option is
- specified, the following C++ files are generated:
- <code><b>name.hxx</b></code> (header file), <code><b>name.ixx</b></code>
- (inline file, generated unless the <code><b>--suppress-inline</b></code>
- option is specified), and <code><b>name.cxx</b></code> (source file).
- If the <code><b>--generate-html</b></code> option is specified, then
- the <code><b>name.html</b></code> HTML documentation file is generated.
- If the <code><b>--generate-man</b></code> option is specified, then
- the <code><b>name.1</b></code> man page file is generated. When
- <code><b>--generate-html</b></code> or <code><b>--generate-man</b></code>
- is specified, the <code><b>--stdout</b></code> option can be used to
- redirect the output to STDOUT instead of a file.</p>
-
- <h1>OPTIONS</h1>
- <dl class="options">
- <dt><code><b>--help</b></code></dt>
- <dd>Print usage information and exit.</dd>
-
- <dt><code><b>--version</b></code></dt>
- <dd>Print version and exit.</dd>
-
- <dt><code><b>--include-path</b></code>|<code><b>-I</b></code> <code><i>dir</i></code></dt>
- <dd>Search <code><i>dir</i></code> for bracket-included
- (<code><b>&lt;></b></code>) options files.</dd>
-
- <dt><code><b>--output-dir</b></code>|<code><b>-o</b></code> <code><i>dir</i></code></dt>
- <dd>Write the generated files to <code><i>dir</i></code> instead of the
- current directory.</dd>
-
- <dt><code><b>--std</b></code> <code><i>version</i></code></dt>
- <dd>Specify the C++ standard that should be used during compilation. Valid
- values are <code><b>c++98</b></code> (default), <code><b>c++11</b></code>,
- and <code><b>c++14</b></code>.</dd>
-
- <dt><code><b>--generate-modifier</b></code></dt>
- <dd>Generate option value modifiers in addition to accessors.</dd>
-
- <dt><code><b>--generate-specifier</b></code></dt>
- <dd>Generate functions for determining whether the option was specified on
- the command line.</dd>
-
- <dt><code><b>--generate-parse</b></code></dt>
- <dd>Generate <code><b>parse()</b></code> functions instead of parsing
- constructors. This is primarily useful for being able to parse into an
- already initialized options class instance, for example, to implement
- option appending/overriding.</dd>
-
- <dt><code><b>--generate-merge</b></code></dt>
- <dd>Generate <code><b>merge()</b></code> functions. This is primarily
- useful for being able to merge several already parsed options class
- instances, for example, to implement option appending/overriding. Note
- that this option forces <code><b>--generate-specifier</b></code>.</dd>
-
- <dt><code><b>--generate-description</b></code></dt>
- <dd>Generate the option description list that can be examined at
- runtime.</dd>
-
- <dt><code><b>--generate-file-scanner</b></code></dt>
- <dd>Generate the <code><b>argv_file_scanner</b></code> implementation.
- This scanner is capable of reading command line arguments from the
- <code><b>argv</b></code> array as well as files specified with command
- line options.</dd>
-
- <dt><code><b>--generate-vector-scanner</b></code></dt>
- <dd>Generate the <code><b>vector_scanner</b></code> implementation. This
- scanner is capable of reading command line arguments from
- <code><b>vector&lt;string></b></code>.</dd>
-
- <dt><code><b>--generate-group-scanner</b></code></dt>
- <dd>Generate the <code><b>group_scanner</b></code> implementation. This
- scanner supports grouping of arguments (usually options) to apply only to
- a certain argument.
-
- <p>Groups can be specified before (leading) and/or after (trailing) the
- argument they apply to. A leading group starts with
- '<code><b>{</b></code>' and ends with '<code><b>}+</b></code>' while a
- trailing group starts with '<code><b>+{</b></code>' and ends with
- '<code><b>}</b></code>'. For example:</p>
-
- <pre>{ --foo --bar }+ arg # 'arg' with '--foo' '--bar'
-arg +{ fox=1 baz=2 } # 'arg' with 'fox=1' 'baz=2'</pre>
-
- <p>Multiple leading and/or trailing groups can be specified for the same
- argument. For example:</p>
-
- <pre>{ -f }+ { -b }+ arg +{ f=1 } +{ b=2 } # 'arg' with '-f' 'b' 'f=1' 'b=2'</pre>
-
- <p>Note that the group applies to a single argument only. For example:</p>
-
- <pre>{ --foo }+ arg1 arg2 +{ --bar } # 'arg1' with '--foo' and
- # 'arg2' with '--bar'</pre>
-
- <p>The group separators ('<code><b>{</b></code>',
- '<code><b>}+'</b></code>, etc) must be separate command line arguments. In
- particular, they must not be adjacent either to the arguments inside the
- group nor to the argument they apply to. All such cases will be treated as
- ordinary arguments. For example:</p>
-
- <pre>{--foo}+ arg # '{--foo}+' ...
-arg+{ --foo } # 'arg+{' ...</pre>
-
- <p>If one of the group separators needs to be specified as an argument
- verbatim, then it must be escaped with '<code><b>\</b></code>'. For
- example:</p>
-
- <pre>} # error: unexpected group separator
-}x # '}x'
-\} # '}'
-{ \}+ }+ arg # 'arg' with '}+'</pre></dd>
-
- <dt><code><b>--suppress-inline</b></code></dt>
- <dd>Generate all functions non-inline. By default simple functions are
- made inline. This option suppresses creation of the inline file.</dd>
-
- <dt><code><b>--suppress-cli</b></code></dt>
- <dd>Do not generate the CLI support types (scanners, parser, etc).
- Normally, the support types are generated unless another
- <code><b>.cli</b></code> was included, in which case the support types are
- expected to be provided by its generated code.</dd>
-
- <dt><code><b>--cli-namespace</b></code> <code><i>ns</i></code></dt>
- <dd>Generate the CLI support types in the <code><i>ns</i></code> namespace
- (<code><b>cli</b></code> by default). The namespace can be nested, for
- example <code><b>details::cli</b></code>. If the namespace is empty, then
- the support types are generated in the global namespace.</dd>
-
- <dt><code><b>--ostream-type</b></code> <code><i>type</i></code></dt>
- <dd>Output stream type instead of the default
- <code><b>std::ostream</b></code> that should be used to print usage and
- exception information.</dd>
-
- <dt><code><b>--generate-cxx</b></code></dt>
- <dd>Generate C++ code. If neither <code><b>--generate-man</b></code>,
- <code><b>--generate-html</b></code>, nor
- <code><b>--generate-txt</b></code> is specified, this mode is assumed by
- default.</dd>
-
- <dt><code><b>--generate-man</b></code></dt>
- <dd>Generate documentation in the man page format.</dd>
-
- <dt><code><b>--generate-html</b></code></dt>
- <dd>Generate documentation in the HTML format.</dd>
-
- <dt><code><b>--generate-txt</b></code></dt>
- <dd>Generate documentation in the plain text format, similar to
- usage.</dd>
-
- <dt><code><b>--stdout</b></code></dt>
- <dd>Write output to STDOUT instead of a file. This option is not valid
- when generating C++ code and is normally used to combine generated
- documentation for several option classes in a single file.</dd>
-
- <dt><code><b>--suppress-undocumented</b></code></dt>
- <dd>Suppress the generation of documentation entries for undocumented
- options.</dd>
-
- <dt><code><b>--suppress-usage</b></code></dt>
- <dd>Suppress the generation of the usage printing code.</dd>
-
- <dt><code><b>--long-usage</b></code></dt>
- <dd>If no short documentation string is provided, use the complete long
- documentation string in usage. By default, in this situation only the
- first sentence from the long string is used.</dd>
-
- <dt><code><b>--short-usage</b></code></dt>
- <dd>If specified together with <code><b>--long-usage</b></code>, generate
- both short and long usage versions. In this mode, the long usage printing
- function is called <code><b>print_long_usage()</b></code> and in its
- implementation the long documentation string is always used, even if the
- short version is provided.</dd>
-
- <dt><code><b>--page-usage</b></code> <code><i>name</i></code></dt>
- <dd>Generate the combined usage printing code for the entire page.
- Specifically, this will include all the namespace-level documentation as
- well as usage for all the options classes printed in the order they are
- defined in the main translation unit (documentation/classes from included
- units are ignored except for base classes).
-
- <p>The <code><i>name</i></code> argument is used as a prefix to form the
- name of the usage printing function. It can include the namespace
- qualification as well as documentation variable expansion, for
- example:</p>
-
- <pre>--page-usage print_ # print_usage() in global namespace
---page-usage app::print_ # print_usage() in app namespace
---page-usage print_$name$_ # print_foo_usage() if name is foo</pre>
-
- <p>If both <code><b>--long-usage</b></code> and
- <code><b>--short-usage</b></code> options are specified, then the long
- usage function has the <code><b>*long_usage()</b></code> suffix.</p></dd>
-
- <dt><code><b>--option-length</b></code> <code><i>len</i></code></dt>
- <dd>Indent option descriptions <code><i>len</i></code> characters when
- printing usage. This is useful when you have multiple options classes,
- potentially in separate files, and would like their usage to have the same
- indentation level.</dd>
-
- <dt><code><b>--ansi-color</b></code></dt>
- <dd>Use ANSI color escape sequences when printing usage. By "color" we
- really only mean the bold and underline modifiers. Note that Windows
- console does not recognize ANSI escape sequences and will display them as
- garbage. However, if you pipe such output through
- <code><b>less(1)</b></code>, it will display them correctly.</dd>
-
- <dt><code><b>--exclude-base</b></code></dt>
- <dd>Exclude base class information from usage and documentation.</dd>
-
- <dt><code><b>--include-base-last</b></code></dt>
- <dd>Include base class information after derived for usage and
- documentation. By default, base classes are included first.</dd>
-
- <dt><code><b>--class-doc</b></code> <code><i>name</i></code>=<code><i>kind</i></code></dt>
- <dd>Specify the documentation <code><i>kind</i></code> that should be used
- for the options class <code><i>name</i></code>. The
- <code><i>name</i></code> value should be a fully-qualified class name, for
- example, <code><b>app::options</b></code>. The <code><i>kind</i></code>
- value can be <code><b>short</b></code>, <code><b>long</b></code>,
- <code><b>exclude</b></code>, or <code><b>exclude-base</b></code>. If the
- value is <code><b>exclude</b></code>, then the class documentation is
- excluded from usage and man/HTML/text output. If it is
- <code><b>exclude-base</b></code>, then it is only excluded when used as a
- base. For usage, the <code><b>short</b></code> and
- <code><b>long</b></code> values determine which usage function will be
- called when the class is used as base or as part of the page usage (see
- <code><b>--page-usage</b></code>). For man/HTML/text, these values
- determine which documentation strings are used in the output.</dd>
-
- <dt><code><b>--class</b></code> <code><i>name</i></code></dt>
- <dd>Generate the man page, HTML, or text documentation only for the
- options class <code><i>name</i></code>. The <code><i>name</i></code> value
- should be a fully-qualified options class name, for example,
- <code><b>app::options</b></code>. To generate documentation for multiple
- classes, repeat this option and the documentation will be produced in the
- order specified. This functionality is useful if you need to assemble
- documentation from multiple classes in a specific order or to insert
- custom documentation between options belonging to different classes.</dd>
-
- <dt><code><b>--docvar</b></code>|<code><b>-v</b></code> <code><i>name</i></code>=<code><i>val</i></code></dt>
- <dd>Set documentation variable <code><i>name</i></code> to the value
- <code><i>val</i></code>. Documentation variables can be substituted in
- prologues and epilogues (see <code><b>--*-prologue*</b></code> and
- <code><b>--*-epilogue*</b></code> options) using the
- <code><b>$</b></code><code><i>name</i></code><code><b>$</b></code>
- expansion syntax (use <code><b>$$</b></code> to escape expansion). They
- can also be defined in <code><b>.cli</b></code> files using the
- <code>"\<code><i>name</i></code>=<code><i>val</i></code>"</code>
- syntax.</dd>
-
- <dt><code><b>--link-regex</b></code> <code><i>regex</i></code></dt>
- <dd>Add <code><i>regex</i></code> to the list of regular expressions used
- to transform link targets in the generated documentation. The argument to
- this option is a Perl-like regular expression in the form
- <code><b>/</b><i>pattern</i><b>/</b><i>replacement</i><b>/</b></code>. Any
- character can be used as a delimiter instead of '<code><b>/</b></code>'
- and the delimiter can be escaped inside <code><i>pattern</i></code> and
- <code><i>replacement</i></code> with a backslash (<code><b>\</b></code>).
- You can specify multiple regular expressions by repeating this option. All
- the regular expressions are tried in the order specified and the first
- expression that matches is used. Use the
- <code><b>--link-regex-trace</b></code> option to debug link
- transformation.</dd>
-
- <dt><code><b>--link-regex-trace</b></code></dt>
- <dd>Trace the process of applying regular expressions specified with the
- <code><b>--link-regex</b></code> option. Use this option to find out why
- your regular expressions don't do what you expected them to do.</dd>
-
- <dt><code><b>--html-heading-map</b></code> <code><i>c</i></code>=<code><i>h</i></code></dt>
- <dd>Map CLI heading <code><i>c</i></code> (valid values:
- '<code><b>H</b></code>', '<code><b>0</b></code>', '<code><b>1</b></code>',
- '<code><b>h</b></code>', and '<code><b>2</b></code>') to HTML heading
- <code><i>h</i></code> (for example, '<code><b>h1</b></code>',
- '<code><b>h2</b></code>', etc).</dd>
-
- <dt><code><b>--omit-link-check</b></code></dt>
- <dd>Don't check that local fragment link references (\l{#ref ...}) resolve
- to ids.</dd>
-
- <dt><code><b>--hxx-prologue</b></code> <code><i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the beginning of the generated C++
- header file.</dd>
-
- <dt><code><b>--ixx-prologue</b></code> <code><i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the beginning of the generated C++
- inline file.</dd>
-
- <dt><code><b>--cxx-prologue</b></code> <code><i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the beginning of the generated C++
- source file.</dd>
-
- <dt><code><b>--man-prologue</b></code> <code><i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the beginning of the generated man
- page file.</dd>
-
- <dt><code><b>--html-prologue</b></code> <code><i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the beginning of the generated HTML
- file.</dd>
-
- <dt><code><b>--txt-prologue</b></code> <code><i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the beginning of the generated text
- file.</dd>
-
- <dt><code><b>--hxx-epilogue</b></code> <code><i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the end of the generated C++ header
- file.</dd>
-
- <dt><code><b>--ixx-epilogue</b></code> <code><i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the end of the generated C++ inline
- file.</dd>
-
- <dt><code><b>--cxx-epilogue</b></code> <code><i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the end of the generated C++ source
- file.</dd>
-
- <dt><code><b>--man-epilogue</b></code> <code><i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the end of the generated man page
- file.</dd>
-
- <dt><code><b>--html-epilogue</b></code> <code><i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the end of the generated HTML
- file.</dd>
-
- <dt><code><b>--txt-epilogue</b></code> <code><i>text</i></code></dt>
- <dd>Insert <code><i>text</i></code> at the end of the generated text
- file.</dd>
-
- <dt><code><b>--hxx-prologue-file</b></code> <code><i>file</i></code></dt>
- <dd>Insert the content of <code><i>file</i></code> at the beginning of the
- generated C++ header file.</dd>
-
- <dt><code><b>--ixx-prologue-file</b></code> <code><i>file</i></code></dt>
- <dd>Insert the content of <code><i>file</i></code> at the beginning of the
- generated C++ inline file.</dd>
-
- <dt><code><b>--cxx-prologue-file</b></code> <code><i>file</i></code></dt>
- <dd>Insert the content of <code><i>file</i></code> at the beginning of the
- generated C++ source file.</dd>
-
- <dt><code><b>--man-prologue-file</b></code> <code><i>file</i></code></dt>
- <dd>Insert the content of <code><i>file</i></code> at the beginning of the
- generated man page file.</dd>
-
- <dt><code><b>--html-prologue-file</b></code> <code><i>file</i></code></dt>
- <dd>Insert the content of <code><i>file</i></code> at the beginning of the
- generated HTML file.</dd>
-
- <dt><code><b>--txt-prologue-file</b></code> <code><i>file</i></code></dt>
- <dd>Insert the content of <code><i>file</i></code> at the beginning of the
- generated text file.</dd>
-
- <dt><code><b>--hxx-epilogue-file</b></code> <code><i>file</i></code></dt>
- <dd>Insert the content of <code><i>file</i></code> at the end of the
- generated C++ header file.</dd>
-
- <dt><code><b>--ixx-epilogue-file</b></code> <code><i>file</i></code></dt>
- <dd>Insert the content of <code><i>file</i></code> at the end of the
- generated C++ inline file.</dd>
-
- <dt><code><b>--cxx-epilogue-file</b></code> <code><i>file</i></code></dt>
- <dd>Insert the content of <code><i>file</i></code> at the end of the
- generated C++ source file.</dd>
-
- <dt><code><b>--man-epilogue-file</b></code> <code><i>file</i></code></dt>
- <dd>Insert the content of <code><i>file</i></code> at the end of the
- generated man page file.</dd>
-
- <dt><code><b>--html-epilogue-file</b></code> <code><i>file</i></code></dt>
- <dd>Insert the content of <code><i>file</i></code> at the end of the
- generated HTML file.</dd>
-
- <dt><code><b>--txt-epilogue-file</b></code> <code><i>file</i></code></dt>
- <dd>Insert the content of <code><i>file</i></code> at the end of the
- generated text file.</dd>
-
- <dt><code><b>--output-prefix</b></code> <code><i>prefix</i></code></dt>
- <dd>Add <code><i>prefix</i></code> at the beginning of the generated
- output file name(s).</dd>
-
- <dt><code><b>--output-suffix</b></code> <code><i>suffix</i></code></dt>
- <dd>Add <code><i>suffix</i></code> at the end of the generated output file
- name(s). Note that it is added before any file type-specific suffixes; see
- <code><b>--*-suffix</b></code> below.</dd>
-
- <dt><code><b>--hxx-suffix</b></code> <code><i>suffix</i></code></dt>
- <dd>Use <code><i>suffix</i></code> instead of the default
- <code><b>.hxx</b></code> to construct the name of the generated header
- file.</dd>
-
- <dt><code><b>--ixx-suffix</b></code> <code><i>suffix</i></code></dt>
- <dd>Use <code><i>suffix</i></code> instead of the default
- <code><b>.ixx</b></code> to construct the name of the generated inline
- file.</dd>
-
- <dt><code><b>--cxx-suffix</b></code> <code><i>suffix</i></code></dt>
- <dd>Use <code><i>suffix</i></code> instead of the default
- <code><b>.cxx</b></code> to construct the name of the generated source
- file.</dd>
-
- <dt><code><b>--man-suffix</b></code> <code><i>suffix</i></code></dt>
- <dd>Use <code><i>suffix</i></code> instead of the default
- <code><b>.1</b></code> to construct the name of the generated man page
- file.</dd>
-
- <dt><code><b>--html-suffix</b></code> <code><i>suffix</i></code></dt>
- <dd>Use <code><i>suffix</i></code> instead of the default
- <code><b>.html</b></code> to construct the name of the generated HTML
- file.</dd>
-
- <dt><code><b>--txt-suffix</b></code> <code><i>suffix</i></code></dt>
- <dd>Use <code><i>suffix</i></code> instead of the default
- <code><b>.txt</b></code> to construct the name of the generated text
- file.</dd>
-
- <dt><code><b>--option-prefix</b></code> <code><i>prefix</i></code></dt>
- <dd>Use <code><i>prefix</i></code> instead of the default
- '<code><b>-</b></code>' as an option prefix. Unknown command line
- arguments that start with this prefix are treated as unknown options. If
- you set the option prefix to the empty value, then all the unknown command
- line arguments will be treated as program arguments.</dd>
-
- <dt><code><b>--option-separator</b></code> <code><i>sep</i></code></dt>
- <dd>Use <code><i>sep</i></code> instead of the default
- '<code><b>--</b></code>' as an optional separator between options and
- arguments. All the command line arguments that are parsed after this
- separator are treated as program arguments. Set the option separator to
- the empty value if you don't want this functionality.</dd>
-
- <dt><code><b>--keep-separator</b></code></dt>
- <dd>Leave the option separator in the scanner. This is primarily useful
- for incremental option parsing.</dd>
-
- <dt><code><b>--no-combined-flags</b></code></dt>
- <dd>Disable support for combining multiple single-character flags into a
- single argument (the <code><b>-xyz</b></code> form that is equivalent to
- <code><b>-x</b></code> <code><b>-y</b></code> <code><b>-z</b></code>). An
- argument is considered a combination of flags if it starts with a single
- option prefix (<code><b>--option-prefix</b></code>) and only contains
- letters and digits. Note that an option with a value may not be part of
- such a combination, not even if it is specified last.</dd>
-
- <dt><code><b>--no-combined-values</b></code></dt>
- <dd>Disable support for combining an option and its value into a single
- argument with the assignment sign (the
- <code><i>option</i><b>=</b><i>value</i></code> form). This functionality
- requires a non-empty option prefix
- (<code><b>--option-prefix</b></code>).</dd>
-
- <dt><code><b>--include-with-brackets</b></code></dt>
- <dd>Use angle brackets (<code><b>&lt;></b></code>) instead of quotes
- (<code><b>""</b></code>) in the generated <code><b>#include</b></code>
- directives.</dd>
-
- <dt><code><b>--include-prefix</b></code> <code><i>prefix</i></code></dt>
- <dd>Add <code><i>prefix</i></code> to the generated
- <code><b>#include</b></code> directive paths.</dd>
-
- <dt><code><b>--guard-prefix</b></code> <code><i>prefix</i></code></dt>
- <dd>Add <code><i>prefix</i></code> to the generated header inclusion
- guards. The prefix is transformed to upper case and characters that are
- illegal in a preprocessor macro name are replaced with underscores.</dd>
-
- <dt><code><b>--reserved-name</b></code> <code><i>name</i></code>=<code><i>rep</i></code></dt>
- <dd>Add <code><i>name</i></code> with an optional <code><i>rep</i></code>
- replacement to the list of names that should not be used as identifiers.
- If provided, the replacement name is used instead. All C++ keywords are
- already in this list.</dd>
-
- <dt><code><b>--options-file</b></code> <code><i>file</i></code></dt>
- <dd>Read additional options from <code><i>file</i></code>. Each option
- should appear on a separate line optionally followed by space or equal
- sign (<code><b>=</b></code>) and an option value. Empty lines and lines
- starting with <code><b>#</b></code> are ignored. Option values can be
- enclosed in double (<code><b>"</b></code>) or single
- (<code><b>'</b></code>) quotes to preserve leading and trailing
- whitespaces as well as to specify empty values. If the value itself
- contains trailing or leading quotes, enclose it with an extra pair of
- quotes, for example <code><b>'"x"'</b></code>. Non-leading and
- non-trailing quotes are interpreted as being part of the option value.
-
- <p>The semantics of providing options in a file is equivalent to providing
- the same set of options in the same order on the command line at the point
- where the <code><b>--options-file</b></code> option is specified except
- that the shell escaping and quoting is not required. Repeat this option to
- specify more than one options file.</p></dd>
- </dl>
-
- <h1>DIAGNOSTICS</h1>
-
- <p>If the input file is not a valid CLI definition, <code><b>cli</b></code>
- will issue diagnostic messages to STDERR and exit with non-zero exit
- code.</p>
-
- <h1>BUGS</h1>
-
- <p>Send bug reports to the
- <a href="mailto:cli-users@codesynthesis.com">cli-users@codesynthesis.com</a> mailing list.</p>
-
- </div>
- <div id="footer">
- Copyright &#169; 2009-2020 Code Synthesis Tools CC.
-
- <div id="terms">
- Permission is granted to copy, distribute and/or modify this
- document under the terms of the
- <a href="http://www.codesynthesis.com/licenses/mit.txt">MIT License</a>.
- </div>
- </div>
-</div>
-</body>
-</html>
diff --git a/doc/guide/makefile b/doc/guide/makefile
deleted file mode 100644
index 40ed0f9..0000000
--- a/doc/guide/makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-# file : doc/guide/makefile
-# author : Boris Kolpackov <boris@codesynthesis.com>
-# license : MIT; see accompanying LICENSE file
-
-include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make
-
-default := $(out_base)/
-install := $(out_base)/.install
-cleandoc := $(out_base)/.cleandoc
-
-# Build.
-#
-$(default): $(out_base)/cli-guide.ps $(out_base)/cli-guide.pdf
-
-
-$(out_base)/cli-guide.ps: $(src_base)/index.xhtml \
- $(src_base)/guide.html2ps \
- | $(out_base)/.
- $(call message,html2ps $<,html2ps -f $(src_base)/guide.html2ps -o $@ $<)
-
-$(out_base)/cli-guide.pdf: $(out_base)/cli-guide.ps | $(out_base)/.
- $(call message,ps2pdf $<,ps2pdf14 $< $@)
-
-# Install.
-#
-$(install): $(out_base)/cli-guide.ps $(out_base)/cli-guide.pdf
- $(call install-data,$(src_base)/index.xhtml,$(install_doc_dir)/cli/guide/index.xhtml)
- $(call install-data,$(src_base)/cli-guide.ps,$(install_doc_dir)/cli/guide/cli-guide.ps)
- $(call install-data,$(src_base)/cli-guide.pdf,$(install_doc_dir)/cli/guide/cli-guide.pdf)
-
-# Clean.
-#
-$(cleandoc):
- $(call message,rm $$1,rm -f $$1,$(out_base)/cli-guide.ps)
- $(call message,rm $$1,rm -f $$1,$(out_base)/cli-guide.pdf)
-
-# How to.
-#
-$(call include,$(bld_root)/install.make)
diff --git a/doc/makefile b/doc/makefile
deleted file mode 100644
index 6ec866e..0000000
--- a/doc/makefile
+++ /dev/null
@@ -1,44 +0,0 @@
-# file : doc/makefile
-# author : Boris Kolpackov <boris@codesynthesis.com>
-# license : MIT; see accompanying LICENSE file
-
-include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make
-
-default := $(out_base)/
-install := $(out_base)/.install
-cleandoc := $(out_base)/.cleandoc
-
-$(default): $(out_base)/cli.xhtml $(out_base)/cli.1 $(out_base)/guide/
-
-# Generated documentation.
-#
-$(out_base)/cli.xhtml: $(src_root)/cli/options.cli \
- $(src_base)/cli-prologue.xhtml \
- $(src_base)/cli-epilogue.xhtml
- $(call message,cli-html $<,$(out_root)/cli/cli --generate-html \
---output-dir $(out_base) --html-prologue-file $(src_base)/cli-prologue.xhtml \
---html-epilogue-file $(src_base)/cli-epilogue.xhtml $<)
- $(call message,,mv $(out_base)/options.html $(out_base)/cli.xhtml)
-
-$(out_base)/cli.1: $(src_root)/cli/options.cli \
- $(src_base)/cli-prologue.1 \
- $(src_base)/cli-epilogue.1
- $(call message,cli-man $<,$(out_root)/cli/cli --generate-man \
---output-dir $(out_base) --man-prologue-file $(src_base)/cli-prologue.1 \
---man-epilogue-file $(src_base)/cli-epilogue.1 $<)
- $(call message,,mv $(out_base)/options.1 $(out_base)/cli.1)
-
-# Install.
-#
-$(install): $(out_base)/guide/.install $(out_base)/cli.xhtml $(out_base)/cli.1
- $(call install-data,$(src_base)/default.css,$(install_doc_dir)/cli/default.css)
- $(call install-data,$(out_base)/cli.xhtml,$(install_doc_dir)/cli/cli.xhtml)
- $(call install-data,$(out_base)/cli.1,$(install_man_dir)/man1/cli.1)
-
-# Clean.
-#
-$(cleandoc): $(out_base)/guide/.cleandoc
-
-$(call include,$(bld_root)/install.make)
-
-$(call import,$(src_base)/guide/makefile)
diff --git a/examples/.gitignore b/examples/.gitignore
deleted file mode 100644
index e54525b..0000000
--- a/examples/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-driver
diff --git a/examples/build/root.build b/examples/build/root.build
deleted file mode 100644
index 5f08770..0000000
--- a/examples/build/root.build
+++ /dev/null
@@ -1,36 +0,0 @@
-# file : examples/build/root.build
-# license : MIT; see accompanying LICENSE file
-
-cxx.std = latest
-
-using cxx
-
-hxx{*}: extension = hxx
-ixx{*}: extension = ixx
-txx{*}: extension = txx
-cxx{*}: extension = cxx
-
-if ($cxx.target.system == 'win32-msvc')
- cxx.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
-
-if ($cxx.class == 'msvc')
- cxx.coptions += /wd4251 /wd4275 /wd4800
-
-# Load cli module. It must be available from the system or from the base
-# project. Generating files with cli is a part of the examples, so distributing
-# pre-generated files would be meaningless.
-#
-# @@ How to initialize the module to use a base project cli executable by
-# default (if present and not configured to use another one)? Should it be
-# assignment like 'config.cli = $out_root/../cli/cli' prior 'using config'
-# in bootstrap.build, but what if it doesn't exist?
-#
-using cli
-
-# Every exe{} in this subproject is by default a test.
-#
-exe{*}: test = true
-
-# Specify the test target for cross-testing.
-#
-test.target = $cxx.target
diff --git a/examples/buildfile b/examples/buildfile
deleted file mode 100644
index 34801a9..0000000
--- a/examples/buildfile
+++ /dev/null
@@ -1,4 +0,0 @@
-# file : examples/buildfile
-# license : MIT; see accompanying LICENSE file
-
-./: {*/ -build/} README
diff --git a/packages.manifest b/packages.manifest
new file mode 100644
index 0000000..6e5ac19
--- /dev/null
+++ b/packages.manifest
@@ -0,0 +1,6 @@
+: 1
+location: cli/
+:
+location: cli-tests/
+:
+location: cli-examples/
diff --git a/tests/.gitignore b/tests/.gitignore
deleted file mode 100644
index 3381565..0000000
--- a/tests/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-driver
-test.?xx
diff --git a/tests/build/root.build b/tests/build/root.build
deleted file mode 100644
index 05bb1de..0000000
--- a/tests/build/root.build
+++ /dev/null
@@ -1,36 +0,0 @@
-# file : tests/build/root.build
-# license : MIT; see accompanying LICENSE file
-
-cxx.std = latest
-
-using cxx
-
-hxx{*}: extension = hxx
-ixx{*}: extension = ixx
-txx{*}: extension = txx
-cxx{*}: extension = cxx
-
-if ($cxx.target.system == 'win32-msvc')
- cxx.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
-
-if ($cxx.class == 'msvc')
- cxx.coptions += /wd4251 /wd4275 /wd4800
-
-# Load cli module. It must be available from the system or from the base
-# project. Generating files with cli is a part of the tests, so distributing
-# pre-generated files would be meaningless.
-#
-# @@ How to initialize the module to use a base project cli executable by
-# default (if present and not configured to use another one)? Should it be
-# assignment like 'config.cli = $out_root/../cli/cli' prior 'using config'
-# in bootstrap.build, but what if it doesn't exist?
-#
-using cli
-
-# Every exe{} in this subproject is by default a test.
-#
-exe{*}: test = true
-
-# Specify the test target for cross-testing.
-#
-test.target = $cxx.target
diff --git a/tests/buildfile b/tests/buildfile
deleted file mode 100644
index 556ed55..0000000
--- a/tests/buildfile
+++ /dev/null
@@ -1,4 +0,0 @@
-# file : tests/buildfile
-# license : MIT; see accompanying LICENSE file
-
-./: {*/ -build/}
diff --git a/tests/headings/buildfile b/tests/headings/buildfile
deleted file mode 100644
index 4ece7d6..0000000
--- a/tests/headings/buildfile
+++ /dev/null
@@ -1,4 +0,0 @@
-# file : tests/headings/buildfile
-# license : MIT; see accompanying LICENSE file
-
-./: testscript
diff --git a/tests/note/buildfile b/tests/note/buildfile
deleted file mode 100644
index f1296d1..0000000
--- a/tests/note/buildfile
+++ /dev/null
@@ -1,4 +0,0 @@
-# file : tests/note/buildfile
-# license : MIT; see accompanying LICENSE file
-
-./: testscript
diff --git a/tests/toc/buildfile b/tests/toc/buildfile
deleted file mode 100644
index 468eebc..0000000
--- a/tests/toc/buildfile
+++ /dev/null
@@ -1,4 +0,0 @@
-# file : tests/toc/buildfile
-# license : MIT; see accompanying LICENSE file
-
-./: testscript
diff --git a/unit-tests/.gitignore b/unit-tests/.gitignore
deleted file mode 100644
index e54525b..0000000
--- a/unit-tests/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-driver
diff --git a/unit-tests/lexer/buildfile b/unit-tests/lexer/buildfile
deleted file mode 100644
index 8b73efe..0000000
--- a/unit-tests/lexer/buildfile
+++ /dev/null
@@ -1,5 +0,0 @@
-# file : unit-tests/lexer/buildfile
-# license : MIT; see accompanying LICENSE file
-
-include ../../cli/
-exe{driver}: {hxx cxx}{*} ../../cli/libue{cli} testscript
diff --git a/unit-tests/parser/buildfile b/unit-tests/parser/buildfile
deleted file mode 100644
index c578296..0000000
--- a/unit-tests/parser/buildfile
+++ /dev/null
@@ -1,5 +0,0 @@
-# file : unit-tests/parser/buildfile
-# license : MIT; see accompanying LICENSE file
-
-include ../../cli/
-exe{driver}: {hxx cxx}{*} ../../cli/libue{cli} testscript