From 45e68584436df2dddd8cf32712fcc568f4786060 Mon Sep 17 00:00:00 2001 From: Gordon Hecker Date: Wed, 17 Mar 2010 11:11:34 +0100 Subject: [PATCH] plugin interface: print the description of each plugin when --version is requested Signed-off-by: Gordon Hecker --- Changelog | 1 + generic/e2option.lua | 2 ++ generic/plugin.lua | 9 +++++++++ 3 files changed, 12 insertions(+) diff --git a/Changelog b/Changelog index 21b751b..15c45e5 100644 --- 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 diff --git a/generic/e2option.lua b/generic/e2option.lua index a073b85..982d190 100644 --- a/generic/e2option.lua +++ b/generic/e2option.lua @@ -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) diff --git a/generic/plugin.lua b/generic/plugin.lua index abe01a0..5377a64 100644 --- a/generic/plugin.lua +++ b/generic/plugin.lua @@ -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 -- 2.39.5