Update OptionProcessor's startup options naming/docs to better reflect reality
AFAICT, contrary to what the documentation, naming, and usage suggest,
OptionProcessor.parsed_startup_options_ can actually be unparsed and is never
null. I'm guessing at some point this was all true, but not now.
PiperOrigin-RevId: 248402326
diff --git a/src/main/cpp/option_processor.h b/src/main/cpp/option_processor.h
index 5cb4ed3..bfe2070 100644
--- a/src/main/cpp/option_processor.h
+++ b/src/main/cpp/option_processor.h
@@ -105,6 +105,8 @@
// Gets the arguments explicitly provided by the user's command line.
std::vector<std::string> GetExplicitCommandArguments() const;
+ // Returns the underlying StartupOptions object with parsed values. Must
+ // only be called after ParseOptions.
virtual StartupOptions* GetParsedStartupOptions() const;
// Prints a message about the origin of startup options. This should be called
@@ -145,9 +147,12 @@
const WorkspaceLayout* workspace_layout_;
- // The startup options parsed from args, this field is initialized by
- // ParseOptions.
- std::unique_ptr<StartupOptions> parsed_startup_options_;
+ // The StartupOptions object defining the startup options which are accepted,
+ // and, after ParseOptions has been called, their values.
+ const std::unique_ptr<StartupOptions> startup_options_;
+
+ // Whether or not ParseOptions has been called.
+ bool parse_options_called_;
// Path to the system-wide bazelrc configuration file.
// This is configurable for testing purposes only.