From c2cd2e73514e98d7909ebf1710ccf325e41a07cf Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 31 Jan 2018 16:19:34 -0600 Subject: [PATCH] common/config: use cerr for --show-config-value Signed-off-by: Sage Weil --- src/common/config.cc | 7 ++++--- src/common/config.h | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/common/config.cc b/src/common/config.cc index 8665707c9583c..d0eefe66b5c0a 100644 --- a/src/common/config.cc +++ b/src/common/config.cc @@ -611,7 +611,7 @@ void md_config_t::do_argv_commands() if (do_show_config_value.size()) { string val; - int r = conf_stringify(_get_val(do_show_config_value), &val); + int r = conf_stringify(_get_val(do_show_config_value, 0, &cerr), &val); if (r < 0) { if (r == -ENOENT) std::cerr << "failed to get config option '" @@ -981,7 +981,8 @@ Option::value_t md_config_t::get_val_generic(const std::string &key) const Option::value_t md_config_t::_get_val( const std::string &key, - expand_stack_t *stack) const + expand_stack_t *stack, + std::ostream *err) const { assert(lock.is_locked()); if (key.empty()) { @@ -997,7 +998,7 @@ Option::value_t md_config_t::_get_val( return Option::value_t(boost::blank()); } - return _get_val(*o, stack); + return _get_val(*o, stack, err); } Option::value_t md_config_t::_get_val( diff --git a/src/common/config.h b/src/common/config.h index 7b90ad43be7d2..684d7113daa8b 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -247,7 +247,8 @@ private: int _get_val_cstr(const std::string &key, char **buf, int len) const; Option::value_t _get_val(const std::string &key, - expand_stack_t *stack=0) const; + expand_stack_t *stack=0, + std::ostream *err=0) const; Option::value_t _get_val(const Option& o, expand_stack_t *stack=0, std::ostream *err=0) const; -- 2.39.5