mirror of
https://github.com/ggerganov/ggwave.git
synced 2026-02-07 01:11:22 +08:00
Initial commit
This commit is contained in:
17
examples/ggwave-common.cpp
Normal file
17
examples/ggwave-common.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "ggwave-common.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
std::map<std::string, std::string> parseCmdArguments(int argc, char ** argv) {
|
||||
int last = argc;
|
||||
std::map<std::string, std::string> res;
|
||||
for (int i = 1; i < last; ++i) {
|
||||
if (argv[i][0] == '-') {
|
||||
if (strlen(argv[i]) > 1) {
|
||||
res[std::string(1, argv[i][1])] = strlen(argv[i]) > 2 ? argv[i] + 2 : "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
Reference in New Issue
Block a user