show keys of lists in the prompt

Change-Id: I29deb2b3aa80734b675c0c8309f785fa2eed7ccc
diff --git a/src/parser.cpp b/src/parser.cpp
index 87ed317..b8ac30d 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -5,6 +5,7 @@
  * Written by Václav Kubernát <kubervac@fit.cvut.cz>
  *
 */
+#include <experimental/iterator>
 #include <ostream>
 #include "parser.hpp"
 
@@ -18,6 +19,28 @@
 {
 }
 
+struct nodeToDataString : public boost::static_visitor<std::string> {
+    std::string operator()(const listElement_& node) const
+    {
+        std::ostringstream res;
+        res << node.m_name + "[";
+        std::transform(node.m_keys.begin(), node.m_keys.end(),
+                       std::experimental::make_ostream_joiner(res, ' '),
+                       [] (const auto& it) { return it.first + "=" + it.second; });
+        res << "]";
+        return res.str();
+    }
+    std::string operator()(const nodeup_&) const
+    {
+        return "..";
+    }
+    template <class T>
+    std::string operator()(const T& node) const
+    {
+        return node.m_name;
+    }
+};
+
 cd_ Parser::parseCommand(const std::string& line, std::ostream& errorStream)
 {
     cd_ parsedCommand;
@@ -53,7 +76,7 @@
 {
     std::string res;
     for (const auto& it : m_curDir.m_nodes) {
-        res = joinPaths(res, boost::apply_visitor(nodeToString(), it));
+        res = joinPaths(res, boost::apply_visitor(nodeToDataString(), it));
     }
 
     return res;