ceph_abort();
}
+void Option::print(ostream *out) const
+{
+ *out << name << " - " << desc << "\n";
+ *out << " (" << type_to_str(type) << ", " << level_to_str(level) << ")\n";
+ if (!boost::get<boost::blank>(&daemon_value)) {
+ *out << " Default (non-daemon): " << stringify(value) << "\n";
+ *out << " Default (daemon): " << stringify(daemon_value) << "\n";
+ } else {
+ *out << " Default: " << stringify(value) << "\n";
+ }
+ if (!enum_allowed.empty()) {
+ *out << " Possible values: ";
+ for (auto& i : enum_allowed) {
+ *out << " " << stringify(i);
+ }
+ *out << "\n";
+ }
+ if (!boost::get<boost::blank>(&min)) {
+ *out << " Minimum: " << stringify(min) << "\n"
+ << " Maximum: " << stringify(max) << "\n";
+ }
+ if (!services.empty()) {
+ *out << " Services: " << services << "\n";
+ }
+ if (!tags.empty()) {
+ *out << " Tags: " << tags << "\n";
+ }
+ if (!see_also.empty()) {
+ *out << " See also: " << see_also << "\n";
+ }
+
+ if (long_desc.size()) {
+ *out << "\n" << long_desc << "\n";
+ }
+}
+
constexpr unsigned long long operator"" _min (unsigned long long min) {
return min * 60;
}
}
void dump(Formatter *f) const;
+ void print(ostream *out) const;
bool has_flag(flag_t f) const {
return flags & f;
cmd_getval(g_ceph_context, cmdmap, "prefix", prefix);
bufferlist odata;
- if (prefix == "config dump") {
+ if (prefix == "config help") {
+ string name;
+ cmd_getval(g_ceph_context, cmdmap, "key", name);
+ const Option *opt = g_conf->find_option(name);
+ if (!opt) {
+ ss << "configuration option '" << name << "' not recognized";
+ err = -ENOENT;
+ goto reply;
+ }
+ if (f) {
+ f->dump_object("option", *opt);
+ f->flush(odata);
+ } else {
+ stringstream ss;
+ opt->print(&ss);
+ odata.append(ss.str());
+ }
+ } else if (prefix == "config dump") {
list<pair<string,Section*>> sections = {
make_pair("global", &config_map.global)
};
COMMAND("config dump",
"Show all configuration option(s)",
"mon", "r", "cli,rest")
+COMMAND("config help " \
+ "name=key,type=CephString",
+ "Describe a configuration option",
+ "config", "r", "cli,rest")