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

Function optional_arg

tests/perf/model_perf.cpp:66–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64};
65
66std::string optional_arg(int argc, char ** argv, const std::string & name, const std::string & fallback) {
67 for (int i = 1; i + 1 < argc; ++i) {
68 if (std::string_view(argv[i]) == name) {
69 return argv[i + 1];
70 }
71 }
72 return fallback;
73}
74
75std::optional<std::string> find_arg(int argc, char ** argv, const std::string & name) {
76 for (int i = 1; i + 1 < argc; ++i) {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected