aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/cpp/blaze_util.h
diff options
context:
space:
mode:
authorGravatar Luis Fernando Pino Duque <lpino@google.com>2016-12-08 16:59:16 +0000
committerGravatar Irina Iancu <elenairina@google.com>2016-12-09 15:31:17 +0000
commitd5e008c72a02dc5b77931e7187dd594a02698ffd (patch)
treedcc8948a522b7c59c76ae1e7fd95dd517631edfa /src/main/cpp/blaze_util.h
parent0f32beda6330bca7d86b219d6624aa18c8cddb1b (diff)
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
Diffstat (limited to 'src/main/cpp/blaze_util.h')
-rw-r--r--src/main/cpp/blaze_util.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/cpp/blaze_util.h b/src/main/cpp/blaze_util.h
index 60a5a243f6..43d97c48d2 100644
--- a/src/main/cpp/blaze_util.h
+++ b/src/main/cpp/blaze_util.h
@@ -55,6 +55,16 @@ const char* GetUnaryOption(const char *arg,
// Returns false otherwise.
bool GetNullaryOption(const char *arg, const char *key);
+// Searches for 'key' in 'args' using GetUnaryOption.
+// Returns true iff key is a flag in args.
+const char* SearchUnaryOption(const std::vector<std::string>& args,
+ const char* key);
+
+// Searches for 'key' in 'args' using GetNullaryOption.
+// Returns the value of the 'key' flag iff it occurs in args.
+bool SearchNullaryOption(const std::vector<std::string>& args,
+ const char* key);
+
// Enable messages mostly of interest to developers.
bool VerboseLogging();