diff options
author | Robert Maynard <rmaynard@nvidia.com> | 2021-05-19 15:05:17 (GMT) |
---|---|---|
committer | Robert Maynard <rmaynard@nvidia.com> | 2021-05-19 15:07:16 (GMT) |
commit | 372bf1bcc410f3e36397bae9834ec141a5fca7ec (patch) | |
tree | a10f416d9f68bc95f13a08df5534510049204de1 /Source/cmakemain.cxx | |
parent | 1b8d409342ec0672ba04e15da13b2a37ec49071a (diff) | |
download | CMake-372bf1bcc410f3e36397bae9834ec141a5fca7ec.zip CMake-372bf1bcc410f3e36397bae9834ec141a5fca7ec.tar.gz CMake-372bf1bcc410f3e36397bae9834ec141a5fca7ec.tar.bz2 |
cmCommandLineArgument: Understands which commands require partial matching
Allows us to provide better error messages when commands such as
`--target` are passed invalid input.
Diffstat (limited to 'Source/cmakemain.cxx')
-rw-r--r-- | Source/cmakemain.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index ad64818..997d855 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -271,6 +271,7 @@ int do_cmake(int ac, char const* const* av) } }, CommandArgument{ "-P", "No script specified for argument -P", CommandArgument::Values::One, + CommandArgument::RequiresSeparator::No, [&](std::string const& value) -> bool { workingMode = cmake::SCRIPT_MODE; parsedArgs.emplace_back("-P"); @@ -476,9 +477,10 @@ int do_build(int ac, char const* const* av) listPresets = true; return true; } }, - CommandArgument{ "-j", CommandArgument::Values::ZeroOrOne, jLambda }, + CommandArgument{ "-j", CommandArgument::Values::ZeroOrOne, + CommandArgument::RequiresSeparator::No, jLambda }, CommandArgument{ "--parallel", CommandArgument::Values::ZeroOrOne, - parallelLambda }, + CommandArgument::RequiresSeparator::No, parallelLambda }, CommandArgument{ "-t", CommandArgument::Values::OneOrMore, targetLambda }, CommandArgument{ "--target", CommandArgument::Values::OneOrMore, targetLambda }, |