Add support for yang type descriptions

Change-Id: I1fd070fb975aa82b2d4c1aa4165c5ab0153ff49f
diff --git a/src/interpreter.cpp b/src/interpreter.cpp
index f1682bf..aaa0595 100644
--- a/src/interpreter.cpp
+++ b/src/interpreter.cpp
@@ -127,6 +127,7 @@
 std::string Interpreter::buildTypeInfo(const std::string& path) const
 {
     std::ostringstream ss;
+    std::string typeDescription;
     switch (m_datastore.schema()->nodeType(path)) {
     case yang::NodeTypes::Container:
         ss << "container";
@@ -156,6 +157,10 @@
             ss << " [" + *leafType.m_units + "]";
         }
 
+        if (leafType.m_description) {
+            typeDescription = "\nType description: " + *leafType.m_description;
+        }
+
         if (m_datastore.schema()->leafIsKey(path)) {
             ss << " (key)";
         }
@@ -184,24 +189,29 @@
     }
 
     if (!m_datastore.schema()->isConfig(path)) {
-        ss << " (ro)";
+        ss << " (ro)\n";
     }
 
-    return ss.str();
-}
-
-void Interpreter::operator()(const describe_& describe) const
-{
-    auto path = pathToString(toCanonicalPath(describe.m_path));
     auto status = m_datastore.schema()->status(path);
     auto statusStr = status == yang::Status::Deprecated ? " (deprecated)" :
         status == yang::Status::Obsolete ? " (obsolete)" :
         "";
 
-    std::cout << path << ": " << buildTypeInfo(path) << statusStr << std::endl;
+    ss << statusStr;
+
     if (auto description = m_datastore.schema()->description(path)) {
-        std::cout << std::endl << *description << std::endl;
+        ss << std::endl << *description << std::endl;
     }
+
+    ss << typeDescription;
+    return ss.str();
+}
+
+void Interpreter::operator()(const describe_& describe) const
+{
+    auto fullPath = pathToString(toCanonicalPath(describe.m_path));
+
+    std::cout << pathToString(describe.m_path) << ": " << buildTypeInfo(fullPath) << std::endl;
 }
 
 void Interpreter::operator()(const move_& move) const