containerName=$1;
shift;
keywords=$@;
- echo "Output from: $containerName container...";
+ echo -e "Output from: ${GREEN}$containerName${ENDCOLOR} container...";
idle-exec-command $containerName apropos $keywords;
}
function ckpackage() {
containerName=$1;
package=$2;
+ echo -e "Output from: ${GREEN}$containerName${ENDCOLOR}";
case $containerName in
alpine) idle-exec-command $containerName "apk search $package";;
archlinux) idle-exec-command $containerName "pacman -Ss $package";;
esac
}
+function help() {
+ echo "idle-cli - InterDistribution Linux Environment CLI";
+ echo "(receive command script)";
+ echo "@ 2023 morketsmerke.org";
+ echo;
+ echo "Options:";
+ echo " list-distros - listing available containers with Linux distros on this server";
+ echo " shell <distro_name> - bring up the shell of given distro";
+ echo " check-commmand <distro_name> <command> - verify is given command exists in given distro";
+ echo " apropos <distro_name> <keywords> - finds commmands match to given keywords";
+ echo " pkgsearch <distro_name> <package> - check is given package is ready to install in given distro";
+ echo;
+ echo "<distro_name> - pointing only one distro, but use also:"
+ echo " <group>:";
+ echo " --deb - .deb packages using distros (debian,kali,ubuntu)";
+ echo " --rpm - .rpm packages using distros (fedora,rocky,opensuse)";
+ echo " --other - other distros don't match to above (alpine,archlinux,gentoo,void)";
+ echo " or <--all> - all 10 available distros (warning, output could be large, use some of pager)";
+}
+
if [ $# -gt 0 ]; then
source /usr/local/bin/idle;
command=$1;
doInContainers $containerName ckpackage $@;;
esac
else
+ help;
exit 1;
fi