allow moving up a node with cd

Change-Id: Id1419fddda4aa2d2c16b5775a43c8df58db98c73
diff --git a/src/utils.cpp b/src/utils.cpp
index 38bfe7d..77466c4 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -14,3 +14,14 @@
     else
         return prefix + '/' + suffix;
 }
+
+std::string stripLastNodeFromPath(const std::string& path)
+{
+    std::string res = path;
+    auto pos = res.find_last_of('/');
+    if (pos == res.npos)
+        res.clear();
+    else
+        res.erase(pos);
+    return res;
+}