summaryrefslogtreecommitdiff
path: root/cpp/lib/common/CommonOptions.h
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-07-20 19:20:01 +0000
committerAlan Conway <aconway@apache.org>2007-07-20 19:20:01 +0000
commite7b091abe3cd14764bea988188f843c016d91a19 (patch)
tree6754e3f4d961a2e35d5681cb380e41e1aa58dd48 /cpp/lib/common/CommonOptions.h
parent83b5d1c769a23982d9fdbfb58ab50cb58e46868a (diff)
downloadqpid-python-e7b091abe3cd14764bea988188f843c016d91a19.tar.gz
Ignore QPID_ env variables that don't correspond to known options.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2@558099 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/lib/common/CommonOptions.h')
-rw-r--r--cpp/lib/common/CommonOptions.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/cpp/lib/common/CommonOptions.h b/cpp/lib/common/CommonOptions.h
index beaeb114e6..086b9742fb 100644
--- a/cpp/lib/common/CommonOptions.h
+++ b/cpp/lib/common/CommonOptions.h
@@ -64,8 +64,13 @@ value_semantic* optValue(T& value, const char* arg) {
/** Environment-to-option name mapping.
* Maps env variable "QPID_SOME_VAR" to option "some-var"
+ * Ignores env vars that dont match known options._
*/
-std::string env2option(const std::string& env);
+struct EnvMapper {
+ EnvMapper(const options_description& o) : opts(o) {}
+ std::string operator()(const std::string& env);
+ const options_description& opts;
+};
/**
* Like boost::program_options::bool_switch but takes reference, not pointer.