|
|
@@ -19,7 +19,7 @@ |
|
|
|
struct Conf { |
|
|
|
std::vector<std::string> args; |
|
|
|
std::vector<std::string> args2; |
|
|
|
std::vector<std::pair<std::string, std::string>> kwargs; |
|
|
|
std::vector<std::pair<std::string, std::string>> kvargs; |
|
|
|
bool exec = false; |
|
|
|
}; |
|
|
|
|
|
|
@@ -54,7 +54,7 @@ static void run(Conf conf) { |
|
|
|
parser.parse(variables); |
|
|
|
} |
|
|
|
|
|
|
|
for (auto &pair: conf.kwargs) { |
|
|
|
for (auto &pair: conf.kvargs) { |
|
|
|
bufio::ISStream ss(pair.second); |
|
|
|
BXParser parser(ss); |
|
|
|
auto &list = variables[pair.first]; |
|
|
@@ -62,7 +62,7 @@ static void run(Conf conf) { |
|
|
|
parser.parseList(variables, list); |
|
|
|
} |
|
|
|
|
|
|
|
if (conf.kwargs.size() > 0) { |
|
|
|
if (conf.kvargs.size() > 0) { |
|
|
|
bufio::OFStream f(path + "/.config.bx"); |
|
|
|
BXWriter w(f); |
|
|
|
w.write(variables); |
|
|
@@ -238,7 +238,7 @@ int main(int argc, char **argv) { |
|
|
|
if (eq == nullptr) { |
|
|
|
conf.args.push_back(arg); |
|
|
|
} else { |
|
|
|
conf.kwargs.push_back(std::make_pair( |
|
|
|
conf.kvargs.push_back(std::make_pair( |
|
|
|
std::string(arg, eq - arg), std::string(eq + 1))); |
|
|
|
} |
|
|
|
} |