nitls: shows the synopsys of modules and groups by default
authorJean Privat <jean@pryen.org>
Thu, 4 Dec 2014 03:03:07 +0000 (22:03 -0500)
committerJean Privat <jean@pryen.org>
Sat, 6 Dec 2014 03:50:28 +0000 (22:50 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

src/nitls.nit

index fc6bd41..0dd3cfd 100644 (file)
@@ -32,11 +32,21 @@ class ProjTree
                        if opt_paths then
                                return o.filepath.as(not null)
                        else
-                               return "{o.name} ({o.filepath.to_s})"
+                               var d = ""
+                               if o.mdoc != null then
+                                       d = ": {o.mdoc.content.first}"
+                               end
+                               return "{o.name} ({o.filepath.to_s}){d}"
                        end
                else if o isa ModulePath then
                        if opt_paths then
                                return o.filepath
+                       else if o.mmodule != null then
+                               var d = ""
+                               if o.mmodule.mdoc != null then
+                                       d = ": {o.mmodule.mdoc.content.first}"
+                               end
+                               return "{o.name}{d} ({o.filepath})"
                        else
                                return "{o.name} ({o.filepath})"
                        end
@@ -108,8 +118,9 @@ else
 
        for a in files do
                var mp = mb.identify_file(a)
-               if mp == null then
-                       tc.check_errors
+               tc.check_errors
+               if mp != null and not opt_paths.value then
+                       mb.load_module(mp.filepath)
                end
        end
 end