Add SearchUnaryOptions and SearchNullaryOptions to improve the parsing
of the startup options.
This allows us to do the following:
- Avoid using the product name when reporting startup option parsing errors.
- Passing --bazelrc as a command argument throws an error (fix for issue #1659).
--
PiperOrigin-RevId: 141445030
MOS_MIGRATED_REVID=141445030
diff --git a/src/main/cpp/startup_options.cc b/src/main/cpp/startup_options.cc
index 461be46..8bd9c3d 100644
--- a/src/main/cpp/startup_options.cc
+++ b/src/main/cpp/startup_options.cc
@@ -306,9 +306,9 @@
if (!extra_argument_processed) {
blaze_util::StringPrintf(
error,
- "Unknown %s startup option: '%s'.\n"
+ "Unknown startup option: '%s'.\n"
" For more info, run '%s help startup_options'.",
- product_name.c_str(), arg, product_name.c_str());
+ arg, GetLowercaseProductName().c_str());
return blaze_exit_code::BAD_ARGV;
}
}
@@ -398,9 +398,4 @@
return blaze_exit_code::SUCCESS;
}
-blaze_exit_code::ExitCode StartupOptions::ValidateStartupOptions(
- const std::vector<string>& args, string* error) {
- return blaze_exit_code::SUCCESS;
-}
-
} // namespace blaze