Add ls
Change-Id: I86f799ff9577940c7df8e01cda6c6b7867de8e7e
diff --git a/src/grammars.hpp b/src/grammars.hpp
index ed21e31..06e1bf8 100644
--- a/src/grammars.hpp
+++ b/src/grammars.hpp
@@ -34,6 +34,7 @@
x3::rule<leaf_data_uint_class, uint32_t> const leaf_data_uint = "leaf_data_uint";
x3::rule<leaf_data_string_class, std::string> const leaf_data_string = "leaf_data_string";
+x3::rule<ls_class, ls_> const ls = "ls";
x3::rule<cd_class, cd_> const cd = "cd";
x3::rule<set_class, set_> const set = "set";
x3::rule<create_class, create_> const create = "create";
@@ -125,6 +126,9 @@
auto const space_separator =
x3::omit[x3::no_skip[space]];
+auto const ls_def =
+ lit("ls") >> -path;
+
auto const cd_def =
lit("cd") >> space_separator > path;
@@ -138,7 +142,7 @@
lit("set") >> space_separator > leafPath > leaf_data;
auto const command_def =
- x3::expect[cd | create | delete_rule | set] >> x3::eoi;
+ x3::expect[cd | create | delete_rule | set | ls] >> x3::eoi;
#if __clang__
#pragma GCC diagnostic pop
@@ -165,6 +169,7 @@
BOOST_SPIRIT_DEFINE(leaf_data_uint)
BOOST_SPIRIT_DEFINE(leaf_data_string)
BOOST_SPIRIT_DEFINE(set)
+BOOST_SPIRIT_DEFINE(ls)
BOOST_SPIRIT_DEFINE(cd)
BOOST_SPIRIT_DEFINE(create)
BOOST_SPIRIT_DEFINE(delete_rule)