From a90f24b0f3923c47318f063c0c9684452c431e1f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 13 Feb 2020 09:27:18 +0200 Subject: Clarify that project type is language-dependent in bdep-new --- bdep/new.cli | 168 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 84 insertions(+), 84 deletions(-) (limited to 'bdep/new.cli') diff --git a/bdep/new.cli b/bdep/new.cli index 8715f72..9340f85 100644 --- a/bdep/new.cli +++ b/bdep/new.cli @@ -28,9 +28,9 @@ namespace bdep \b{bdep new} [] \b{--package} [] []\n \b{bdep new} [] \b{--subdirectory} [] []} - \c{ \ \ \ \ = [] [] []\n - \ \ \ \ = \b{--type}|\b{-t} (\b{exe}|\b{lib}|\b{bare}|\b{empty})[\b{,}...]\n + \c{ \ \ \ \ = [] [] []\n \ \ \ \ = \b{--lang}|\b{-l} (\b{c}|\b{c++})[\b{,}...]\n + \ \ \ \ = \b{--type}|\b{-t} (\b{exe}|\b{lib}|\b{bare}|\b{empty})[\b{,}...]\n \ \ \ \ \ = \b{--vcs}|\b{-s} \ (\b{git}|\b{none})[\b{,}...]\n = \b{--directory}|\b{-d} \n = [\b{--} ] [\b{--existing}|\b{-e} | ( | )...]} @@ -50,7 +50,7 @@ namespace bdep \l{bdep-init(1)} command with the \cb{--empty} option. For example: \ - $ bdep new -t exe -l c++ hello + $ bdep new -l c++ -t exe hello \ Similarly, the second and third forms add an existing or create new build @@ -59,7 +59,7 @@ namespace bdep \cb{--config-create} option, respectively. For example: \ - $ bdep new -t exe -l c++ -C @gcc hello cc config.cxx=g++ + $ bdep new -l c++ -t exe -C @gcc hello cc config.cxx=g++ \ The \cb{--package} form adds the new package to the @@ -72,8 +72,8 @@ namespace bdep $ bdep new -t empty hello $ cd hello - $ bdep new --package -t lib -l c++ libhello - $ bdep new --package -t exe -l c++ hello + $ bdep new --package -l c++ -t lib libhello + $ bdep new --package -l c++ -t exe hello $ bdep init -C @gcc cc config.cxx=g++ \ @@ -93,8 +93,8 @@ namespace bdep $ bdep new -t bare hello $ cd hello - $ bdep new --subdirectory -t lib -l c++ libhello - $ bdep new --subdirectory -t exe -l c++ hello + $ bdep new --subdirectory -l c++ -t lib libhello + $ bdep new --subdirectory -l c++ -t exe hello $ bdep init -C @gcc cc config.cxx=g++ \ @@ -121,24 +121,93 @@ namespace bdep $ git clone .../libhello.git $ cd libhello - $ bdep new -t lib -l c++ + $ bdep new -l c++ -t lib \ - The project parameters such as type (executable, library, etc), language, + The project parameters such as language, type (executable, library, etc), and version control system can be customized as described next. Some of these parameters also support parameter-specific sub-options (such as the file extensions to use in a C++ project) that can be specified with a comma after the parameter value. + The project language can be specified with the \c{\b{--lang}|\b{-l}} + option. Valid values for this option and their semantics are described + next. If unspecified, a C++ project is created by default. + + \dl| + + \li|\cb{c} + + A C project.|| + + \dl| + + \li|\cb{c++} + + A C++ project. Recognized language sub-options:| + + \li|\n\ \ \ \cb{binless} + + Create a header-only library.| + + \li|\n\ \ \ \cb{cpp} + + Use the \cb{.cpp}, \cb{.hpp}, \cb{.ipp}, \cb{.tpp}, and \cb{.mpp} + source file extensions (alias for \cb{extension=?pp}).| + + \li|\n\ \ \ \c{\b{extension=}\i{pattern}} + + Derive source file extensions from \ci{pattern} by replacing + every \cb{?} with one of the \cb{c} (source), \cb{h} (header), + \cb{i} (inline), \cb{t} (template), or \cb{m} (module interface) + letters. If unspecified and no individual extensions are specified + with the below options, then \cb{?xx} is used by default.| + + \li|\n\ \ \ \c{\b{hxx=}\i{extension}} + + Use the specified \ci{extension} for header files instead of + the default \cb{.hxx}.| + + \li|\n\ \ \ \c{\b{cxx=}\i{extension}} + + Use the specified \ci{extension} for source files instead of + the default \cb{.cxx}.| + + \li|\n\ \ \ \c{\b{ixx=}\i{extension}} + + Use the specified \ci{extension} for inline files. If + unspecified, then assume no inline files are used by the + project.| + + \li|\n\ \ \ \c{\b{txx=}\i{extension}} + + Use the specified \ci{extension} for template files. If + unspecified, then assume no template files are used by the + project.| + + \li|\n\ \ \ \c{\b{mxx=}\i{extension}} + + Use the specified \ci{extension} for module interface files. If + unspecified, then assume no modules are used by the project.|| + + As an example, the following command creates a header-only C++ library + that uses the \cb{.h} extension for header files and \cb{.cpp} \- for + source files: + + \ + $ bdep new -l c++,binless,hxx=h,cxx=cpp -t lib libhello + \ + The project type can be specified with the \c{\b{--type}|\b{-t}} option. - Valid values for this option and their semantics are described next. If - unspecified, an executable project is created by default. + The \cb{empty} project type is language-agnostic with the semantics and + valid sub-options for the rest being language-dependant, as described + next. If unspecified, an executable project is created by default. \dl| \li|\cb{exe} - A project that builds a sample executable. Recognized + A project that builds a sample C or C++ executable. Recognized executable project sub-options:| \li|\n\ \ \ \cb{no-tests} @@ -165,7 +234,7 @@ namespace bdep \li|\cb{lib} - A project that builds a sample library. Recognized library + A project that builds a sample C or C++ library. Recognized library project sub-options:| \li|\n\ \ \ \cb{no-tests} @@ -220,8 +289,7 @@ namespace bdep \li|\cb{empty} An empty project that can be filled with packages (see - \cb{--package}). Note that the project language is ignored for this - project type. Recognized empty project sub-options:| + \cb{--package}). Recognized empty project sub-options:| \li|\n\ \ \ \cb{no-readme} @@ -249,74 +317,6 @@ namespace bdep Use the alternative build file/directory naming scheme.|| - The project language can be specified with the \c{\b{--lang}|\b{-l}} - option. Valid values for this option and their semantics are described - next. If unspecified, a C++ project is created by default. - - \dl| - - \li|\cb{c} - - A C project.|| - - \dl| - - \li|\cb{c++} - - A C++ project. Recognized language sub-options:| - - \li|\n\ \ \ \cb{binless} - - Create a header-only library.| - - \li|\n\ \ \ \cb{cpp} - - Use the \cb{.cpp}, \cb{.hpp}, \cb{.ipp}, \cb{.tpp}, and \cb{.mpp} - source file extensions (alias for \cb{extension=?pp}).| - - \li|\n\ \ \ \c{\b{extension=}\i{pattern}} - - Derive source file extensions from \ci{pattern} by replacing - every \cb{?} with one of the \cb{c} (source), \cb{h} (header), - \cb{i} (inline), \cb{t} (template), or \cb{m} (module interface) - letters. If unspecified and no individual extensions are specified - with the below options, then \cb{?xx} is used by default.| - - \li|\n\ \ \ \c{\b{hxx=}\i{extension}} - - Use the specified \ci{extension} for header files instead of - the default \cb{.hxx}.| - - \li|\n\ \ \ \c{\b{cxx=}\i{extension}} - - Use the specified \ci{extension} for source files instead of - the default \cb{.cxx}.| - - \li|\n\ \ \ \c{\b{ixx=}\i{extension}} - - Use the specified \ci{extension} for inline files. If - unspecified, then assume no inline files are used by the - project.| - - \li|\n\ \ \ \c{\b{txx=}\i{extension}} - - Use the specified \ci{extension} for template files. If - unspecified, then assume no template files are used by the - project.| - - \li|\n\ \ \ \c{\b{mxx=}\i{extension}} - - Use the specified \ci{extension} for module interface files. If - unspecified, then assume no modules are used by the project.|| - - As an example, the following command creates a header-only C++ library - that uses the \cb{.h} extension for header files and \cb{.cpp} \- for - source files: - - \ - $ bdep new -t lib -l c++,binless,hxx=h,cxx=cpp libhello - \ - The project version control system can be specified with the \c{\b{--vcs}|\b{-s}} option. Valid values for this option and their semantics are described next. If unspecified, \cb{git} is assumed by -- cgit v1.1