]> git.e2factory.org Git - e2factory.git/commitdiff
e2-ls-project: fix and add two options
authorTobias Ulmer <tu@emlix.com>
Mon, 24 Oct 2016 14:54:51 +0000 (16:54 +0200)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:18 +0000 (15:41 +0100)
--chroot shows all chroot groups
--env shows the result environment

Signed-off-by: Tobias Ulmer <tu@emlix.com>
doc/man/e2-ls-project.1.in
local/e2-ls-project.lua

index 8c88dbdc1d054fc715f21bc9dc672bf824da2e9a..eabe0a9e33a4cf98ad0f49471fd471875505bd61 100644 (file)
@@ -1,8 +1,8 @@
 .\" Man page for e2-ls-project
 .\"
-.\" (c)2007, 2012 emlix GmbH
+.\" (c)2007-2016 emlix GmbH
 .\"
-.TH e2-ls-project 1 "Oct 16, 2012" "@VERSION@"
+.TH e2-ls-project 1 "@VERSION@"
 
 .SH NAME
 e2-ls-project \- show project information of an e2factory project
@@ -35,6 +35,12 @@ As "\-\-dot", but also show sources.
 .BR \-\-swap
 Swaps the direction of the graphs.
 .TP
+.BR \-\-chroot
+Also show chroot groups.
+.TP
+.BR \-\-env
+Also show env variables.
+.TP
 For further global options, see \fBe2factory\fR(1).
 .TP
 .BR \-\-check
@@ -56,4 +62,4 @@ e2-ls-project --dot | dot -Tpdf > project.pdf
 .BR e2factory (1)
 
 .SH COPYRIGHT
-(c)2013 emlix GmbH
+(c)2007-2016 emlix GmbH
index 1b43919e1d4e3b5b6b53de152052f9b4bf955621..d5e8139598f2316bea2365c35941c98b5a62793d 100644 (file)
@@ -48,6 +48,8 @@ local function e2_ls_project(arg)
     e2option.flag("dot-sources", "generate dot(1) graph with sources included")
     e2option.flag("swap", "swap arrow directions in dot graph")
     e2option.flag("all", "show unused results and sources, too")
+    e2option.flag("chroot", "show chroot groups as well")
+    e2option.flag("env", "show environment vars as well")
 
     local opts, arguments = e2option.parse(arg)
     if not opts then
@@ -96,12 +98,10 @@ local function e2_ls_project(arg)
         for _, resultname in pairs(results) do
             local res = result.results[resultname]
 
-            if res:isInstanceOf(result.result_class) then
-                for sourcename in res:sources_list():iter_sorted() do
-                    if not yet[sourcename] then
-                        table.insert(sources, sourcename)
-                        yet[sourcename] = true
-                    end
+            for sourcename in res:sources_list():iter_sorted() do
+                if not yet[sourcename] then
+                    table.insert(sources, sourcename)
+                    yet[sourcename] = true
                 end
             end
         end
@@ -182,7 +182,7 @@ local function e2_ls_project(arg)
             else
                 console.infof("  \"%s\"\n", r)
             end
-            if opts["dot-sources"] and res:isInstanceOf(result.result_class) then
+            if opts["dot-sources"] then
                 for src in res:sources_list():iter_sorted() do
                     if opts.swap then
                         console.infof("  \"%s-src\" %s \"%s\"\n", src, arrow, r)
@@ -273,7 +273,8 @@ local function e2_ls_project(arg)
             s2 = "|"
         end
 
-        for _,at in ipairs(res:attribute_table({env = true, chroot=true})) do
+        local flagt = { env = opts.env, chroot = opts.chroot }
+        for _,at in ipairs(res:attribute_table(flagt)) do
             p3(s1, s2, unpack(at))
         end
     end