export: Improve error message consistency

Remove literal text "subcommand" from error messages. Most other
commands report errors like "<command> <subcommand> <message>", where
the message does not include the literal text "subcommand". The `export`
command was one of two exceptions to this.
This commit is contained in:
Matthew Woehlke
2025-12-01 14:08:56 -05:00
parent 91d7d19a89
commit 61143d7cef
6 changed files with 19 additions and 21 deletions

View File

@@ -270,8 +270,8 @@ static bool HandleExportMode(std::vector<std::string> const& args,
}
if (!unknownArgs.empty()) {
status.SetError("EXPORT subcommand given unknown argument: \"" +
unknownArgs.front() + "\".");
status.SetError("EXPORT given unknown argument: \"" + unknownArgs.front() +
"\".");
return false;
}
@@ -384,8 +384,8 @@ static bool HandleSetupMode(std::vector<std::string> const& args,
SetupArguments arguments = parser.Parse(args, &unknownArgs);
if (!unknownArgs.empty()) {
status.SetError("SETUP subcommand given unknown argument: \"" +
unknownArgs.front() + "\".");
status.SetError("SETUP given unknown argument: \"" + unknownArgs.front() +
"\".");
return false;
}

View File

@@ -1,64 +1,64 @@
CMake Error at BadArgs4\.cmake:[0-9]+ \(export\):
export EXPORT subcommand given unknown argument: "LOWER_CASE_FILE"\.
export EXPORT given unknown argument: "LOWER_CASE_FILE"\.
Call Stack \(most recent call first\):
CMakeLists\.txt:3 \(include\)
CMake Error at BadArgs4\.cmake:[0-9]+ \(export\):
export EXPORT subcommand given unknown argument: "APPENDIX"\.
export EXPORT given unknown argument: "APPENDIX"\.
Call Stack \(most recent call first\):
CMakeLists\.txt:3 \(include\)
CMake Error at BadArgs4\.cmake:[0-9]+ \(export\):
export EXPORT subcommand given unknown argument: "VERSION"\.
export EXPORT given unknown argument: "VERSION"\.
Call Stack \(most recent call first\):
CMakeLists\.txt:3 \(include\)
CMake Error at BadArgs4\.cmake:[0-9]+ \(export\):
export EXPORT subcommand given unknown argument: "LICENSE"\.
export EXPORT given unknown argument: "LICENSE"\.
Call Stack \(most recent call first\):
CMakeLists\.txt:3 \(include\)
CMake Error at BadArgs4\.cmake:[0-9]+ \(export\):
export EXPORT subcommand given unknown argument: "DEFAULT_LICENSE"\.
export EXPORT given unknown argument: "DEFAULT_LICENSE"\.
Call Stack \(most recent call first\):
CMakeLists\.txt:3 \(include\)
CMake Error at BadArgs4\.cmake:[0-9]+ \(export\):
export EXPORT subcommand given unknown argument: "DESCRIPTION"\.
export EXPORT given unknown argument: "DESCRIPTION"\.
Call Stack \(most recent call first\):
CMakeLists\.txt:3 \(include\)
CMake Error at BadArgs4\.cmake:[0-9]+ \(export\):
export EXPORT subcommand given unknown argument: "HOMEPAGE_URL"\.
export EXPORT given unknown argument: "HOMEPAGE_URL"\.
Call Stack \(most recent call first\):
CMakeLists\.txt:3 \(include\)
CMake Error at BadArgs4\.cmake:[0-9]+ \(export\):
export EXPORT subcommand given unknown argument: "DEFAULT_TARGETS"\.
export EXPORT given unknown argument: "DEFAULT_TARGETS"\.
Call Stack \(most recent call first\):
CMakeLists\.txt:3 \(include\)
CMake Error at BadArgs4\.cmake:[0-9]+ \(export\):
export EXPORT subcommand given unknown argument: "DEFAULT_CONFIGURATIONS"\.
export EXPORT given unknown argument: "DEFAULT_CONFIGURATIONS"\.
Call Stack \(most recent call first\):
CMakeLists\.txt:3 \(include\)
CMake Error at BadArgs4\.cmake:[0-9]+ \(export\):
export EXPORT subcommand given unknown argument: "PROJECT"\.
export EXPORT given unknown argument: "PROJECT"\.
Call Stack \(most recent call first\):
CMakeLists\.txt:3 \(include\)
CMake Error at BadArgs4\.cmake:[0-9]+ \(export\):
export EXPORT subcommand given unknown argument: "NO_PROJECT_METADATA"\.
export EXPORT given unknown argument: "NO_PROJECT_METADATA"\.
Call Stack \(most recent call first\):
CMakeLists\.txt:3 \(include\)

View File

@@ -1,2 +1,2 @@
CMake Error at ExperimentalGate\.cmake:5 \(export\):
export EXPORT subcommand given unknown argument: "PACKAGE_INFO"\.
export EXPORT given unknown argument: "PACKAGE_INFO"\.

View File

@@ -1,4 +1,4 @@
CMake Error at AppendExport\.cmake:[0-9]+ \(export\):
export EXPORT subcommand given unknown argument: "APPEND"\.
export EXPORT given unknown argument: "APPEND"\.
Call Stack \(most recent call first\):
CMakeLists\.txt:3 \(include\)

View File

@@ -1,5 +1,4 @@
^CMake Error at FindDependencyExportGate\.cmake:[0-9]+ \(export\):
export EXPORT subcommand given unknown argument:
"EXPORT_PACKAGE_DEPENDENCIES"\.
export EXPORT given unknown argument: "EXPORT_PACKAGE_DEPENDENCIES"\.
Call Stack \(most recent call first\):
CMakeLists\.txt:[0-9]+ \(include\)$

View File

@@ -1,5 +1,4 @@
CMake Error at OldIface\.cmake:[0-9]+ \(export\):
export EXPORT subcommand given unknown argument:
"EXPORT_LINK_INTERFACE_LIBRARIES"\.
export EXPORT given unknown argument: "EXPORT_LINK_INTERFACE_LIBRARIES"\.
Call Stack \(most recent call first\):
CMakeLists\.txt:3 \(include\)