Migrate to libyang2
libnetconf2: getSchema and getConfig were no longer used in netconf-cli,
so I deleted them. They can get readded once the bindings get split into
a separate project.
sysrepo_access: Some sr_val stuff was removed.
YangSchema: type descriptions are not available
availableNodes returns only input nodes for RPC nodes
impl_getSchemaNode: no longer disables error printing
libyang: No longer supports leafrefs without the leaf it points to.
Depends-on: https://cesnet-gerrit-czechlight/c/CzechLight/dependencies/+/5171
Depends-on: https://gerrit.cesnet.cz/c/CzechLight/dependencies/+/5171
Change-Id: Ie49381a003a61a7bb028be7b2fa1d9d926ac4e58
diff --git a/src/cli.cpp b/src/cli.cpp
index fec77d1..24ed37e 100644
--- a/src/cli.cpp
+++ b/src/cli.cpp
@@ -138,6 +138,7 @@
}
if (const auto& enableFeatures = args["-e"]) {
namespace x3 = boost::spirit::x3;
+ std::map<std::string, std::vector<std::string>> toEnable;
auto grammar = +(x3::char_-":") >> ":" >> +(x3::char_-":");
for (const auto& enableFeature : enableFeatures.asStringList()) {
std::pair<std::string, std::string> parsed;
@@ -147,12 +148,15 @@
std::cerr << "Error parsing feature enable flags: " << enableFeature << "\n";
return 1;
}
- try {
- datastore->enableFeature(parsed.first, parsed.second);
- } catch (std::runtime_error& ex) {
- std::cerr << ex.what() << "\n";
- return 1;
+ toEnable[parsed.first].emplace_back(parsed.second);
+ }
+ try {
+ for (const auto& [moduleName, features] : toEnable) {
+ datastore->setEnabledFeatures(moduleName, features);
}
+ } catch (std::runtime_error& ex) {
+ std::cerr << ex.what() << "\n";
+ return 1;
}
}