Commit 459f4fa4 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-prescription: improve list

parent b2c4caff
...@@ -48,16 +48,30 @@ local psdir="$CONFIGDIR/prescription.d" ...@@ -48,16 +48,30 @@ local psdir="$CONFIGDIR/prescription.d"
if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then
cat <<EOF cat <<EOF
Options: Options:
receipt - run receipt <receipt> - run receipt
--list-all - list all available receipts --list-all - list all available receipts
EOF EOF
exit exit
fi fi
[ "$($DISTRVENDOR -a)" = "x86_64" ] && IGNOREi586='' || IGNOREi586=1
if [ "$1" == "--list-all" ] || [ -z "$*" ] ; then if [ "$1" == "--list-all" ] || [ -z "$*" ] ; then
if [ -n "$short" ] ; then
for i in $psdir/*.sh ; do
local name=$(basename $i .sh)
[ -n "$IGNOREi586" ] && rhas "$name" "^i586-" && continue
rhas "$name" "^common" && continue
echo "$name"
done
exit
fi
echo "Run with a name of a prescription to run:" echo "Run with a name of a prescription to run:"
for i in $psdir/*.sh ; do for i in $psdir/*.sh ; do
printf " %-20s - %s\n" "$(basename $i .sh)" "$($i --description 2>/dev/null)" local name=$(basename $i .sh)
[ -n "$IGNOREi586" ] && rhas "$name" "^i586-" && continue
rhas "$name" "^common" && continue
printf " %-20s - %s\n" "$name" "$($i --description 2>/dev/null)"
done done
echo echo
exit exit
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment