diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index 2d639b68ecf..e23ddd8231c 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -408,7 +408,8 @@ project binary tree: .. code-block:: shell - cmake --build [ | --preset ] [] [-- ] + cmake --build [] [-- ] + cmake --build --preset [] [-- ] This abstracts a native build tool's command-line interface with the following options: diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index d83183f3909..1725375d95a 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -600,7 +600,10 @@ int do_build(int ac, char const* const* av) if (dir.empty() && presetName.empty() && !listPresets) { /* clang-format off */ std::cerr << - "Usage: cmake --build [ | --preset ] [options] [-- [native-options]]\n" + "Usage: cmake --build " + " [options] [-- [native-options]]\n" + " cmake --build --preset " + " [options] [-- [native-options]]\n" "Options:\n" " = Project binary directory to be built.\n" " --preset , --preset=\n" diff --git a/Tests/RunCMake/CommandLine/BuildDir--build--parallel-bad-number-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-bad-number-stderr.txt index 16f8be8b0e9..96de4d17dbd 100644 --- a/Tests/RunCMake/CommandLine/BuildDir--build--parallel-bad-number-stderr.txt +++ b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-bad-number-stderr.txt @@ -1,3 +1,3 @@ ^'--parallel' invalid number '12ab' given\. + -Usage: cmake --build \[ \| --preset \] \[options\] \[-- \[native-options\]\] +Usage: cmake --build +\[options\] \[-- \[native-options\]\] diff --git a/Tests/RunCMake/CommandLine/BuildDir--build--parallel-large-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-large-stderr.txt index e7b9aaaf2aa..0bb806ff43f 100644 --- a/Tests/RunCMake/CommandLine/BuildDir--build--parallel-large-stderr.txt +++ b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-large-stderr.txt @@ -1,3 +1,3 @@ ^The value is too large\. + -Usage: cmake --build \[ \| --preset \] \[options\] \[-- \[native-options\]\] +Usage: cmake --build +\[options\] \[-- \[native-options\]\] diff --git a/Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-bad-number-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-bad-number-stderr.txt index 16f8be8b0e9..96de4d17dbd 100644 --- a/Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-bad-number-stderr.txt +++ b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-bad-number-stderr.txt @@ -1,3 +1,3 @@ ^'--parallel' invalid number '12ab' given\. + -Usage: cmake --build \[ \| --preset \] \[options\] \[-- \[native-options\]\] +Usage: cmake --build +\[options\] \[-- \[native-options\]\] diff --git a/Tests/RunCMake/CommandLine/BuildDir--build--parallel-zero-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-zero-stderr.txt index d1241f46dbc..b965d4a47c2 100644 --- a/Tests/RunCMake/CommandLine/BuildDir--build--parallel-zero-stderr.txt +++ b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-zero-stderr.txt @@ -1,3 +1,3 @@ ^The value requires a positive integer argument\. + -Usage: cmake --build \[ \| --preset \] \[options\] \[-- \[native-options\]\] +Usage: cmake --build +\[options\] \[-- \[native-options\]\] diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-jobs-bad-number-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-bad-number-stderr.txt index d52b16583a8..97e90ec99a6 100644 --- a/Tests/RunCMake/CommandLine/BuildDir--build-jobs-bad-number-stderr.txt +++ b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-bad-number-stderr.txt @@ -1,3 +1,3 @@ ^'-j' invalid number '12ab' given\. + -Usage: cmake --build \[ \| --preset \] \[options\] \[-- \[native-options\]\] +Usage: cmake --build +\[options\] \[-- \[native-options\]\] diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-jobs-large-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-large-stderr.txt index e7b9aaaf2aa..0bb806ff43f 100644 --- a/Tests/RunCMake/CommandLine/BuildDir--build-jobs-large-stderr.txt +++ b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-large-stderr.txt @@ -1,3 +1,3 @@ ^The value is too large\. + -Usage: cmake --build \[ \| --preset \] \[options\] \[-- \[native-options\]\] +Usage: cmake --build +\[options\] \[-- \[native-options\]\] diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-bad-number-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-bad-number-stderr.txt index d52b16583a8..97e90ec99a6 100644 --- a/Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-bad-number-stderr.txt +++ b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-bad-number-stderr.txt @@ -1,3 +1,3 @@ ^'-j' invalid number '12ab' given\. + -Usage: cmake --build \[ \| --preset \] \[options\] \[-- \[native-options\]\] +Usage: cmake --build +\[options\] \[-- \[native-options\]\] diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-jobs-zero-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-zero-stderr.txt index d1241f46dbc..b965d4a47c2 100644 --- a/Tests/RunCMake/CommandLine/BuildDir--build-jobs-zero-stderr.txt +++ b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-zero-stderr.txt @@ -1,3 +1,3 @@ ^The value requires a positive integer argument\. + -Usage: cmake --build \[ \| --preset \] \[options\] \[-- \[native-options\]\] +Usage: cmake --build +\[options\] \[-- \[native-options\]\] diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-with-clean-first-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-with-clean-first-stderr.txt index 2dd9bc42495..c15fdbabd9e 100644 --- a/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-with-clean-first-stderr.txt +++ b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-with-clean-first-stderr.txt @@ -1,2 +1,2 @@ ^Error: Building 'clean' and other targets together is not supported\. -Usage: cmake --build \[ \| --preset \] \[options\] \[-- \[native-options\]\] +Usage: cmake --build +\[options\] \[-- \[native-options\]\] diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-with-clean-second-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-with-clean-second-stderr.txt index 2dd9bc42495..c15fdbabd9e 100644 --- a/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-with-clean-second-stderr.txt +++ b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-with-clean-second-stderr.txt @@ -1,2 +1,2 @@ ^Error: Building 'clean' and other targets together is not supported\. -Usage: cmake --build \[ \| --preset \] \[options\] \[-- \[native-options\]\] +Usage: cmake --build +\[options\] \[-- \[native-options\]\] diff --git a/Tests/RunCMake/CommandLine/build-no-dir-stderr.txt b/Tests/RunCMake/CommandLine/build-no-dir-stderr.txt index 9b4d26bc29e..4811bea2f7b 100644 --- a/Tests/RunCMake/CommandLine/build-no-dir-stderr.txt +++ b/Tests/RunCMake/CommandLine/build-no-dir-stderr.txt @@ -1 +1 @@ -^Usage: cmake --build \[ \| --preset \] \[options\] \[-- \[native-options\]\] +^Usage: cmake --build +\[options\] \[-- \[native-options\]\] diff --git a/Tests/RunCMake/CommandLine/build-unknown-command-long-stderr.txt b/Tests/RunCMake/CommandLine/build-unknown-command-long-stderr.txt index c8f1a03cb82..559e4b61350 100644 --- a/Tests/RunCMake/CommandLine/build-unknown-command-long-stderr.txt +++ b/Tests/RunCMake/CommandLine/build-unknown-command-long-stderr.txt @@ -1,2 +1,2 @@ ^Unknown argument --invalid-command -Usage: cmake --build \[ \| --preset \] \[options\] \[-- \[native-options\]\] +Usage: cmake --build +\[options\] \[-- \[native-options\]\] diff --git a/Tests/RunCMake/CommandLine/build-unknown-command-partial-match-stderr.txt b/Tests/RunCMake/CommandLine/build-unknown-command-partial-match-stderr.txt index e4ad6b2da41..1f44c4e33fc 100644 --- a/Tests/RunCMake/CommandLine/build-unknown-command-partial-match-stderr.txt +++ b/Tests/RunCMake/CommandLine/build-unknown-command-partial-match-stderr.txt @@ -1,2 +1,2 @@ ^Unknown argument --targetinvalid -Usage: cmake --build \[ \| --preset \] \[options\] \[-- \[native-options\]\] +Usage: cmake --build +\[options\] \[-- \[native-options\]\] diff --git a/Tests/RunCMake/CommandLine/build-unknown-command-short-stderr.txt b/Tests/RunCMake/CommandLine/build-unknown-command-short-stderr.txt index a6cfeceaced..4f5ba558bcf 100644 --- a/Tests/RunCMake/CommandLine/build-unknown-command-short-stderr.txt +++ b/Tests/RunCMake/CommandLine/build-unknown-command-short-stderr.txt @@ -1,2 +1,2 @@ ^Unknown argument -invalid-command -Usage: cmake --build \[ \| --preset \] \[options\] \[-- \[native-options\]\] +Usage: cmake --build +\[options\] \[-- \[native-options\]\]