blob: 14d4132ef200a1749c268698438cf6d1c851e874 [file] [log] [blame]
ccalvarin5305a362018-04-20 13:56:55 -07001// 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
22namespace blaze {
23
24// BazelStartupOptions contains the startup options that are Bazel-specific.
25class BazelStartupOptions : public StartupOptions {
26 public:
27 explicit BazelStartupOptions(const WorkspaceLayout *workspace_layout);
28
jcater6bd0aa42019-07-08 09:10:05 -070029 void AddExtraOptions(std::vector<std::string> *result) const override;
30
ccalvarin5305a362018-04-20 13:56:55 -070031 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;
ccalvarin90e116c2018-05-15 16:41:19 -070034
35 void MaybeLogStartupOptionWarnings() const override;
36
Laszlo Csomor5697da92019-08-23 01:41:52 -070037 protected:
38 std::string GetRcFileBaseName() const override { return ".bazelrc"; }
39
ccalvarin90e116c2018-05-15 16:41:19 -070040 private:
41 std::string user_bazelrc_;
ccalvarin5e5ee0d2018-08-23 08:56:01 -070042 bool use_system_rc;
43 bool use_workspace_rc;
44 bool use_home_rc;
45 // TODO(b/36168162): Remove the master rc flag.
ccalvarin90e116c2018-05-15 16:41:19 -070046 bool use_master_bazelrc_;
ccalvarin5305a362018-04-20 13:56:55 -070047};
48
49} // namespace blaze
50
51#endif // BAZEL_SRC_MAIN_CPP_BAZEL_STARTUP_OPTIONS_H_