mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
cmake --workflow: Improve errors when no preset is specified
Add a better error message and tests to verify.
This commit is contained in:
@@ -991,7 +991,8 @@ int do_workflow(int ac, char const* const* av)
|
||||
cmCommandLineArgument<bool(std::string const& value)>;
|
||||
|
||||
std::vector<CommandArgument> arguments = {
|
||||
CommandArgument{ "--preset", CommandArgument::Values::One,
|
||||
CommandArgument{ "--preset", "No preset specified for --preset",
|
||||
CommandArgument::Values::One,
|
||||
CommandArgument::setToValue(presetName) },
|
||||
CommandArgument{ "--list-presets", CommandArgument::Values::Zero,
|
||||
[&listPresets](std::string const&) -> bool {
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1 @@
|
||||
^CMake Error: No preset specified for --preset
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1 @@
|
||||
^CMake Error: No preset specified for --preset
|
||||
@@ -81,6 +81,8 @@ unset(CMakeUserPresets_FILE)
|
||||
unset(CMakePresets_ASSETS)
|
||||
|
||||
run_cmake_workflow_presets(ListPresets --list-presets)
|
||||
run_cmake_command(PresetsNoArg-workflow ${CMAKE_COMMAND} "--workflow" "--preset")
|
||||
run_cmake_command(PresetsNoArgEq-workflow ${CMAKE_COMMAND} "--workflow" "--preset=")
|
||||
run_cmake_workflow_presets(InvalidOption -DINVALID_OPTION)
|
||||
|
||||
set(RunCMake_TEST_NO_CLEAN TRUE)
|
||||
|
||||
Reference in New Issue
Block a user