packages/net/nginx-util/src/uci-cxx.cpp
acooler15 204bc8f478 update nginx-util to 1.5-1
use UCI for server configuration
2021-02-11 10:40:03 +08:00

23 lines
545 B
C++

#include <iostream>
#include <mutex>
#include <string>
#include <string_view>
#include <vector>
#include "uci-cxx.hpp"
auto main() -> int
{
uci::element p = uci::package{"nginx"};
std::cout << "package " << p.name() << "\n\n";
for (auto s : p) {
std::cout << "config " << s.type() << " '" << s.name() << "'\n";
for (auto o : s) {
for (auto i : o) {
std::cout << "\t" << o.type() << " " << o.name() << " '" << i.name() << "'\n";
}
}
std::cout << "\n";
}
}