From 26b58a61d598a7ffb431ef48137e5d4a8d4c9a47 Mon Sep 17 00:00:00 2001 From: Lukas Macura Date: Sat, 9 Apr 2016 12:24:47 +0200 Subject: [PATCH] Added functions for zaf plugin 0.4 --- lib/zaf.lib.sh | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/zaf.lib.sh b/lib/zaf.lib.sh index 00d74f7..f467fc6 100644 --- a/lib/zaf.lib.sh +++ b/lib/zaf.lib.sh @@ -272,7 +272,9 @@ zaf_discovery_plugins() { zaf_list_plugins | zaf_discovery '{#PLUGIN}' } -zaf_plugin_version() { +# $1 plugin +# $2 ctrl_option +zaf_plugin_option() { local plugindir local cfile @@ -282,12 +284,28 @@ zaf_plugin_version() { if zaf_is_plugin "$1"; then plugindir="${ZAF_PLUGINS_DIR}/$1" cfile="$plugindir/control.zaf" - zaf_ctrl_get_global_option $cfile Version + zaf_ctrl_get_global_option $cfile $2 else zaf_err "Plugin $1 not installed." fi } +zaf_plugin_version() { + zaf_plugin_option "$1" Version +} +zaf_plugin_maintainer() { + zaf_plugin_option "$1" Maintainer +} +zaf_plugin_url() { + zaf_plugin_option "$1" Url +} +zaf_plugin_web() { + zaf_plugin_option "$1" Web +} +zaf_plugin_template_url() { + echo $(zaf_plugin_option "$1" Url)/template.xml +} + zaf_list_plugin_items() { local items local i