aboutsummaryrefslogtreecommitdiffstats
path: root/checks/getopt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'checks/getopt.cpp')
-rw-r--r--checks/getopt.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/checks/getopt.cpp b/checks/getopt.cpp
index a30134ff9..c0145ca75 100644
--- a/checks/getopt.cpp
+++ b/checks/getopt.cpp
@@ -12,7 +12,8 @@ OptionParser::OptionParser(const std::string& opt_string)
flags.push_back(OptionFlag(opts[j]));
}
-OptionParser::OptionFlag OptionParser::find_option(const std::string& name) const
+OptionParser::OptionFlag
+OptionParser::find_option(const std::string& name) const
{
for(size_t j = 0; j != flags.size(); j++)
if(flags[j].name() == name)
@@ -33,6 +34,11 @@ std::string OptionParser::value(const std::string& key) const
return i->second;
}
+std::string OptionParser::value_if_set(const std::string& key) const
+ {
+ return is_set(key) ? value(key) : "";
+ }
+
void OptionParser::parse(char* argv[])
{
std::vector<std::string> args;