From a6070b480fe5b0201d845614c762bf2d594948c3 Mon Sep 17 00:00:00 2001 From: Alex Turbov Date: Sat, 13 Aug 2022 03:03:23 +0400 Subject: 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. --- Help/manual/cmake.1.rst | 17 ++++++++++------- Help/manual/ctest.1.rst | 5 +++-- Source/cmakemain.cxx | 11 +++++------ 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index 1e44b6c..1f91a25 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -497,10 +497,12 @@ Options a variable called ``MYVAR`` to ``1``, but the user sets it to ``2`` with a ``-D`` argument, the value ``2`` is preferred. -.. option:: --list-presets, --list-presets=<[configure | build | test | all]> +.. option:: --list-presets[=] - Lists the available presets. If no option is specified only configure presets - will be listed. The current working directory must contain CMake preset files. + Lists the available presets of the specified ````. Valid values for + ```` are ``configure``, ``build``, ``test``, or ``all``. If ```` + is omitted, ``configure`` is assumed. The current working directory must + contain CMake preset files. .. _`Build Tool Mode`: @@ -560,14 +562,15 @@ following options: Build target ``clean`` first, then build. (To clean only, use :option:`--target clean `.) -.. option:: --resolve-package-references= +.. option:: --resolve-package-references= .. versionadded:: 3.23 Resolve remote package references from external package managers (e.g. NuGet) - before build. When set to ``on`` (default), packages will be restored before - building a target. When set to ``only``, the packages will be restored, but no - build will be performed. When set to ``off``, no packages will be restored. + before build. When ```` is set to ``on`` (default), packages will be + restored before building a target. When ```` is set to ``only``, the + packages will be restored, but no build will be performed. When + ```` is set to ``off``, no packages will be restored. If the target does not define any package references, this option does nothing. diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst index 5f6927f..8e0be19 100644 --- a/Help/manual/ctest.1.rst +++ b/Help/manual/ctest.1.rst @@ -419,9 +419,10 @@ Run Tests This option will not run any tests, it will simply print the list of all labels associated with the test set. -.. option:: --no-tests=<[error|ignore]> +.. option:: --no-tests= - Regard no tests found either as error or ignore it. + Regard no tests found either as error (when ```` is set to + ``error``) or ignore it (when ```` is set to ``ignore``). 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 diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 5837bc5..6f3d0eb 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -71,7 +71,7 @@ const char* cmDocumentationUsageNote[][2] = { const char* cmDocumentationOptions[][2] = { CMAKE_STANDARD_OPTIONS_TABLE, { "--preset ,--preset=", "Specify a configure preset." }, - { "--list-presets", "List available presets." }, + { "--list-presets[=]", "List available presets." }, { "-E", "CMake command mode." }, { "-L[A][H]", "List non-advanced cached variables." }, { "--fresh", @@ -83,8 +83,8 @@ const char* cmDocumentationOptions[][2] = { { "-P ", "Process script mode." }, { "--find-package", "Legacy pkg-config like mode. Do not use." }, { "--graphviz=", - "Generate graphviz of dependencies, see " - "CMakeGraphVizOptions.cmake for more." }, + "Generate graphviz of dependencies, see CMakeGraphVizOptions.cmake for " + "more." }, { "--system-information [file]", "Dump information about this system." }, { "--log-level=", "Set the verbosity of messages from CMake files. " @@ -109,8 +109,7 @@ const char* cmDocumentationOptions[][2] = { { "--warn-uninitialized", "Warn about uninitialized values." }, { "--no-warn-unused-cli", "Don't warn about command line options." }, { "--check-system-vars", - "Find problems with variable usage in system " - "files." }, + "Find problems with variable usage in system files." }, { "--compile-no-warning-as-error", "Ignore COMPILE_WARNING_AS_ERROR property and " "CMAKE_COMPILE_WARNING_AS_ERROR variable." }, @@ -616,7 +615,7 @@ int do_build(int ac, char const* const* av) " = Project binary directory to be built.\n" " --preset , --preset=\n" " = Specify a build preset.\n" - " --list-presets\n" + " --list-presets[=]\n" " = List available build presets.\n" " --parallel [], -j []\n" " = Build in parallel using the given number of jobs. \n" -- cgit v0.12