diff options
-rwxr-xr-x | actions.sh | 23 |
1 files changed, 15 insertions, 8 deletions
@@ -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 } |