Help: Use placeholder instead of listing choices in option lines

This avoids any ambiguity with whether the choices are literal
values or not. It also makes the option lines more concise.
This commit is contained in:
Alex Turbov
2022-08-13 03:03:23 +04:00
parent 8ba20cb56f
commit a6070b480f
3 changed files with 18 additions and 15 deletions

View File

@@ -497,10 +497,12 @@ Options
a variable called ``MYVAR`` to ``1``, but the user sets it to ``2`` with a a variable called ``MYVAR`` to ``1``, but the user sets it to ``2`` with a
``-D`` argument, the value ``2`` is preferred. ``-D`` argument, the value ``2`` is preferred.
.. option:: --list-presets, --list-presets=<[configure | build | test | all]> .. option:: --list-presets[=<type>]
Lists the available presets. If no option is specified only configure presets Lists the available presets of the specified ``<type>``. Valid values for
will be listed. The current working directory must contain CMake preset files. ``<type>`` are ``configure``, ``build``, ``test``, or ``all``. If ``<type>``
is omitted, ``configure`` is assumed. The current working directory must
contain CMake preset files.
.. _`Build Tool Mode`: .. _`Build Tool Mode`:
@@ -560,14 +562,15 @@ following options:
Build target ``clean`` first, then build. Build target ``clean`` first, then build.
(To clean only, use :option:`--target clean <cmake --target>`.) (To clean only, use :option:`--target clean <cmake --target>`.)
.. option:: --resolve-package-references=<on|off|only> .. option:: --resolve-package-references=<value>
.. versionadded:: 3.23 .. versionadded:: 3.23
Resolve remote package references from external package managers (e.g. NuGet) Resolve remote package references from external package managers (e.g. NuGet)
before build. When set to ``on`` (default), packages will be restored before before build. When ``<value>`` is set to ``on`` (default), packages will be
building a target. When set to ``only``, the packages will be restored, but no restored before building a target. When ``<value>`` is set to ``only``, the
build will be performed. When set to ``off``, no packages will be restored. packages will be restored, but no build will be performed. When
``<value>`` is set to ``off``, no packages will be restored.
If the target does not define any package references, this option does nothing. If the target does not define any package references, this option does nothing.

View File

@@ -419,9 +419,10 @@ Run Tests
This option will not run any tests, it will simply print the list of This option will not run any tests, it will simply print the list of
all labels associated with the test set. all labels associated with the test set.
.. option:: --no-tests=<[error|ignore]> .. option:: --no-tests=<action>
Regard no tests found either as error or ignore it. Regard no tests found either as error (when ``<action>`` is set to
``error``) or ignore it (when ``<action>`` is set to ``ignore``).
If no tests were found, the default behavior of CTest is to always log an If no tests were found, the default behavior of CTest is to always log an
error message but to return an error code in script mode only. This option error message but to return an error code in script mode only. This option

View File

@@ -71,7 +71,7 @@ const char* cmDocumentationUsageNote[][2] = {
const char* cmDocumentationOptions[][2] = { const char* cmDocumentationOptions[][2] = {
CMAKE_STANDARD_OPTIONS_TABLE, CMAKE_STANDARD_OPTIONS_TABLE,
{ "--preset <preset>,--preset=<preset>", "Specify a configure preset." }, { "--preset <preset>,--preset=<preset>", "Specify a configure preset." },
{ "--list-presets", "List available presets." }, { "--list-presets[=<type>]", "List available presets." },
{ "-E", "CMake command mode." }, { "-E", "CMake command mode." },
{ "-L[A][H]", "List non-advanced cached variables." }, { "-L[A][H]", "List non-advanced cached variables." },
{ "--fresh", { "--fresh",
@@ -83,8 +83,8 @@ const char* cmDocumentationOptions[][2] = {
{ "-P <file>", "Process script mode." }, { "-P <file>", "Process script mode." },
{ "--find-package", "Legacy pkg-config like mode. Do not use." }, { "--find-package", "Legacy pkg-config like mode. Do not use." },
{ "--graphviz=<file>", { "--graphviz=<file>",
"Generate graphviz of dependencies, see " "Generate graphviz of dependencies, see CMakeGraphVizOptions.cmake for "
"CMakeGraphVizOptions.cmake for more." }, "more." },
{ "--system-information [file]", "Dump information about this system." }, { "--system-information [file]", "Dump information about this system." },
{ "--log-level=<ERROR|WARNING|NOTICE|STATUS|VERBOSE|DEBUG|TRACE>", { "--log-level=<ERROR|WARNING|NOTICE|STATUS|VERBOSE|DEBUG|TRACE>",
"Set the verbosity of messages from CMake files. " "Set the verbosity of messages from CMake files. "
@@ -109,8 +109,7 @@ const char* cmDocumentationOptions[][2] = {
{ "--warn-uninitialized", "Warn about uninitialized values." }, { "--warn-uninitialized", "Warn about uninitialized values." },
{ "--no-warn-unused-cli", "Don't warn about command line options." }, { "--no-warn-unused-cli", "Don't warn about command line options." },
{ "--check-system-vars", { "--check-system-vars",
"Find problems with variable usage in system " "Find problems with variable usage in system files." },
"files." },
{ "--compile-no-warning-as-error", { "--compile-no-warning-as-error",
"Ignore COMPILE_WARNING_AS_ERROR property and " "Ignore COMPILE_WARNING_AS_ERROR property and "
"CMAKE_COMPILE_WARNING_AS_ERROR variable." }, "CMAKE_COMPILE_WARNING_AS_ERROR variable." },
@@ -616,7 +615,7 @@ int do_build(int ac, char const* const* av)
" <dir> = Project binary directory to be built.\n" " <dir> = Project binary directory to be built.\n"
" --preset <preset>, --preset=<preset>\n" " --preset <preset>, --preset=<preset>\n"
" = Specify a build preset.\n" " = Specify a build preset.\n"
" --list-presets\n" " --list-presets[=<type>]\n"
" = List available build presets.\n" " = List available build presets.\n"
" --parallel [<jobs>], -j [<jobs>]\n" " --parallel [<jobs>], -j [<jobs>]\n"
" = Build in parallel using the given number of jobs. \n" " = Build in parallel using the given number of jobs. \n"