summaryrefslogtreecommitdiff
path: root/actions.sh
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis.hoffmann@rwth-aachen.de>2022-05-06 02:18:31 +0200
committerJannis M. Hoffmann <jannis.hoffmann@rwth-aachen.de>2022-05-06 02:18:31 +0200
commit3fbc68b0892b2914471eeab7885bd4f9e7f9175f (patch)
tree5862a5863bea3647ff901dc005db7ac9366eec0f /actions.sh
parent92657fe1d84d96aca31e10196a089eacdce721af (diff)
improved actions help implementation
added list_deps action
Diffstat (limited to 'actions.sh')
-rwxr-xr-xactions.sh23
1 files changed, 15 insertions, 8 deletions
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
}