]> git.e2factory.org Git - e2factory.git/commitdiff
plugin interface: print the description of each plugin when --version is
authorGordon Hecker <gh@emlix.com>
Wed, 17 Mar 2010 10:11:34 +0000 (11:11 +0100)
committerGordon Hecker <gh@emlix.com>
Wed, 17 Mar 2010 10:19:02 +0000 (11:19 +0100)
requested

Signed-off-by: Gordon Hecker <gh@emlix.com>
Changelog
generic/e2option.lua
generic/plugin.lua

index 21b751b1c07c9bff8a04285e7c8be0f093292923..15c45e52320f45577b90bf25210a7fb25f739721 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,5 @@
 NEXT:
+ * version information for plugins is displayed now when requested
 
 e2factory-2.3.4rc1
  * the plugin interface was extended to permit plugins to register
index a073b85679db5897d91aab49e19ab89b121909bf..982d190efc34c89a88bf0ad95de30e9394c61d28 100644 (file)
@@ -29,6 +29,7 @@ module("e2option", package.seeall)
 require("e2lib")
 require("e2util")
 require("collection")
+require("plugin")
 
 -- Parsing of command-line options
 
@@ -236,6 +237,7 @@ function parse(args)
     flag("version", "show version number",
                  function()
                    print(buildconfig.VERSIONSTRING)
+                   plugin.print_descriptions()
                    e2lib.finish(0)
                  end,
                  category)
index abe01a002c219e32a756847d04d9bfd15dafb935..5377a64c7ac8359ab616a156a8612c133673fac4 100644 (file)
@@ -142,3 +142,12 @@ function exit_plugins()
   end
   return true, nil
 end
+
+--- print a description for each plugin. This is for use with the --version
+-- option. This version always succeeds.
+-- @return nil
+function print_descriptions()
+  for i,pd in ipairs(plugins) do
+    print(pd.description)
+  end
+end