Allow data path to end with a list for get and ls
Change-Id: I3facc8315fa6192da4318012a85121de37e7314b
diff --git a/src/parser.cpp b/src/parser.cpp
index bb17495..ee0233e 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -70,11 +70,12 @@
}
};
-std::set<std::string> Parser::availableNodes(const boost::optional<dataPath_>& path, const Recursion& option) const
+
+std::set<std::string> Parser::availableNodes(const boost::optional<boost::variant<dataPath_, schemaPath_>>& path, const Recursion& option) const
{
auto pathArg = dataPathToSchemaPath(m_curDir);
if (path) {
- auto schemaPath = dataPathToSchemaPath(*path);
+ auto schemaPath = boost::apply_visitor(getSchemaPathVisitor(), *path);
pathArg.m_nodes.insert(pathArg.m_nodes.end(), schemaPath.m_nodes.begin(), schemaPath.m_nodes.end());
}
return m_schema->childNodes(pathArg, option);