From: Chris Koeritz Date: Fri, 18 May 2018 16:27:11 +0000 (-0400) Subject: nice change for wildcard display X-Git-Tag: 2.140.112^2~37 X-Git-Url: https://feistymeow.org/gitweb/?p=feisty_meow.git;a=commitdiff_plain;h=b88291228a119aad677528c664205844b6c4ec17 nice change for wildcard display used to fail if no package name was provided but now treats that as a wildcarding opportunity to show all packages. --- diff --git a/scripts/system/list_packages.sh b/scripts/system/list_packages.sh index b4b030c2..60024c75 100644 --- a/scripts/system/list_packages.sh +++ b/scripts/system/list_packages.sh @@ -2,21 +2,30 @@ source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" +if [ -z "$*" ]; then + # no parameters, so we do a wildcard style of listing packages. + SEEK_PIECE=' cat ' +else + # we know the parameters are not empty, so we don't go with our + # wildcard approach for listing the package names. + SEEK_PIECE=' grep $* ' +fi + if debian_like; then - dpkg -la | grep $* + dpkg -la | eval $SEEK_PIECE exit $? fi rpm_available="$(which rpm)" if [ ! -z "$rpm_available" ]; then #is that the right phrase for rpm? somewhat forgotten. - rpm -qa | grep $* + rpm -qa | eval $SEEK_PIECE exit $? fi yum_available="$(which yum)" if [ ! -z "$yum_available" ]; then - yum list | grep $* + yum list | eval $SEEK_PIECE exit $? fi