MCPcopy Create free account
hub / github.com/ceph/ceph / cmddesc_get_args

Function cmddesc_get_args

src/common/cmdparse.cc:68–84  ·  view source on GitHub ↗

Snarf up all the key=val,key=val pairs, put 'em in a dict.

Source from the content-addressed store, hash-verified

66
67// Snarf up all the key=val,key=val pairs, put 'em in a dict.
68arg_desc_t cmddesc_get_args(const string_view cmddesc)
69{
70 arg_desc_t arg_desc;
71 for_each_substr(cmddesc, ",", [&](auto kv) {
72 // key=value; key by itself implies value is bool true
73 // name="name" means arg dict will be titled 'name'
74 auto equal = kv.find('=');
75 if (equal == kv.npos) {
76 // it should be the command
77 return;
78 }
79 auto key = kv.substr(0, equal);
80 auto val = kv.substr(equal + 1);
81 arg_desc[key] = val;
82 });
83 return arg_desc;
84}
85
86std::string cmddesc_get_prenautilus_compat(const std::string &cmddesc)
87{

Callers 3

dump_cmd_to_jsonFunction · 0.85
validate_cmdFunction · 0.85

Calls 3

for_each_substrFunction · 0.85
substrMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected