From 3fbc68b0892b2914471eeab7885bd4f9e7f9175f Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Fri, 6 May 2022 02:18:31 +0200 Subject: improved actions help implementation added list_deps action --- actions.sh | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'actions.sh') diff --git a/actions.sh b/actions.sh index bfa7c00..9eb4a37 100755 --- a/actions.sh +++ b/actions.sh @@ -40,17 +40,24 @@ check_manifest () { perl -nE 'chomp; say unless -e' MANIFEST } +help_text="$help_text list_deps\t[]\tlists all non core dependencies\n" +list_deps () { + core="$(corelist -v v5.34.1 | awk '{ print $1 }')" + deps="$(perl -wE 'use lib "lib"; use Module::Load::Conditional "requires"; @res = requires "JWebmail"; $" = "\n"; say $res[0] ? "@res" : ""')" + + for dep in $deps + do + if echo "$core" | grep -qxF "$dep" + then : + else echo "$dep" + fi + done +} + help () { echo "The following actions are available:" echo - help_text="$(printf "$help_text")" # expand escapes in string - IFS=' -' # newline char - for var in $help_text - do - IFS="$(printf '\t')" - printf "%-17s %-8s %s\n" $var # expand var - done + printf "$help_text" | expand -t 19,29 echo } -- cgit v1.2.3