MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / collect_key_value_args

Function collect_key_value_args

app/cli/args.cpp:35–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35std::unordered_map<std::string, std::string> collect_key_value_args(
36 int argc,
37 char ** argv,
38 const std::string & name) {
39 std::unordered_map<std::string, std::string> values;
40 for (const auto & item : collect_args(argc, argv, name)) {
41 const auto pos = item.find('=');
42 if (pos == std::string::npos || pos == 0 || pos + 1 >= item.size()) {
43 throw std::runtime_error("expected " + name + " key=value, got: " + item);
44 }
45 values[item.substr(0, pos)] = item.substr(pos + 1);
46 }
47 return values;
48}
49
50void set_option(
51 std::unordered_map<std::string, std::string> & options,

Callers 2

build_request_from_cliFunction · 0.85
mainFunction · 0.85

Calls 3

collect_argsFunction · 0.85
findMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected