ccalvarin | 5305a36 | 2018-04-20 13:56:55 -0700 | [diff] [blame] | 1 | // Copyright 2018 The Bazel Authors. All rights reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | #ifndef BAZEL_SRC_MAIN_CPP_BAZEL_STARTUP_OPTIONS_H_ |
| 15 | #define BAZEL_SRC_MAIN_CPP_BAZEL_STARTUP_OPTIONS_H_ |
| 16 | |
| 17 | #include <string> |
| 18 | |
| 19 | #include "src/main/cpp/startup_options.h" |
| 20 | #include "src/main/cpp/util/exit_code.h" |
| 21 | |
| 22 | namespace blaze { |
| 23 | |
| 24 | // BazelStartupOptions contains the startup options that are Bazel-specific. |
| 25 | class BazelStartupOptions : public StartupOptions { |
| 26 | public: |
| 27 | explicit BazelStartupOptions(const WorkspaceLayout *workspace_layout); |
| 28 | |
jcater | 6bd0aa4 | 2019-07-08 09:10:05 -0700 | [diff] [blame] | 29 | void AddExtraOptions(std::vector<std::string> *result) const override; |
| 30 | |
ccalvarin | 5305a36 | 2018-04-20 13:56:55 -0700 | [diff] [blame] | 31 | blaze_exit_code::ExitCode ProcessArgExtra( |
| 32 | const char *arg, const char *next_arg, const std::string &rcfile, |
| 33 | const char **value, bool *is_processed, std::string *error) override; |
ccalvarin | 90e116c | 2018-05-15 16:41:19 -0700 | [diff] [blame] | 34 | |
| 35 | void MaybeLogStartupOptionWarnings() const override; |
| 36 | |
Laszlo Csomor | 5697da9 | 2019-08-23 01:41:52 -0700 | [diff] [blame] | 37 | protected: |
| 38 | std::string GetRcFileBaseName() const override { return ".bazelrc"; } |
| 39 | |
ccalvarin | 90e116c | 2018-05-15 16:41:19 -0700 | [diff] [blame] | 40 | private: |
| 41 | std::string user_bazelrc_; |
ccalvarin | 5e5ee0d | 2018-08-23 08:56:01 -0700 | [diff] [blame] | 42 | bool use_system_rc; |
| 43 | bool use_workspace_rc; |
| 44 | bool use_home_rc; |
| 45 | // TODO(b/36168162): Remove the master rc flag. |
ccalvarin | 90e116c | 2018-05-15 16:41:19 -0700 | [diff] [blame] | 46 | bool use_master_bazelrc_; |
ccalvarin | 5305a36 | 2018-04-20 13:56:55 -0700 | [diff] [blame] | 47 | }; |
| 48 | |
| 49 | } // namespace blaze |
| 50 | |
| 51 | #endif // BAZEL_SRC_MAIN_CPP_BAZEL_STARTUP_OPTIONS_H_ |