Commit b9bfcc89 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm play: separate list code to a functions

parent a6e7fb21
......@@ -85,6 +85,53 @@ __epm_play_run()
docmd bash $bashopt $script "$@"
}
__epm_play_list_installed()
{
local i
if [ -n "$short" ] ; then
for i in $(__list_installed_app) ; do
echo "$i"
done
exit
fi
[ -n "$quiet" ] || echo "Installed applications:"
for i in $(__list_installed_app) ; do
local desc="$(__get_app_description $psdir/$i.sh)"
[ -n "$desc" ] || continue
[ -n "$quiet" ] || echo -n " "
printf "%-20s - %s\n" "$i" "$desc"
done
}
__epm_play_list()
{
local psdir="$1"
local i
local IGNOREi586
[ "$($DISTRVENDOR -a)" = "x86_64" ] && IGNOREi586='' || IGNOREi586=1
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
for i in $psdir/*.sh ; do
local desc="$(__get_app_description $i)"
[ -n "$desc" ] || continue
local name=$(basename $i .sh)
[ -n "$IGNOREi586" ] && rhas "$name" "^i586-" && continue
rhas "$name" "^common" && continue
[ -n "$quiet" ] || echo -n " "
printf "%-20s - %s\n" "$name" "$desc"
done
}
__epm_play_help()
{
cat <<EOF
......@@ -150,51 +197,18 @@ fi
if [ "$1" = "--installed" ] ; then
shift
__check_installed_app "$1"
#[ -n "$quiet" ] && exit
exit
fi
if [ "$1" = "--list" ] ; then
shift
local i
if [ -n "$short" ] ; then
for i in $(__list_installed_app) ; do
echo "$i"
done
exit
fi
[ -n "$quiet" ] || echo "Installed:"
for i in $(__list_installed_app) ; do
local desc="$(__get_app_description $psdir/$i.sh)"
[ -n "$desc" ] || continue
[ -n "$quiet" ] || echo -n " "
printf "%-20s - %s\n" "$i" "$desc"
done
__epm_play_list_installed
exit
fi
[ "$($DISTRVENDOR -a)" = "x86_64" ] && IGNOREi586='' || IGNOREi586=1
if [ "$1" = "--list-all" ] || [ -z "$*" ] ; then
local i
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
[ -n "$quiet" ] || echo "Run with a name of a play script to run:"
for i in $psdir/*.sh ; do
local desc="$(__get_app_description $i)"
[ -n "$desc" ] || continue
local name=$(basename $i .sh)
[ -n "$IGNOREi586" ] && rhas "$name" "^i586-" && continue
rhas "$name" "^common" && continue
[ -n "$quiet" ] || echo -n " "
printf "%-20s - %s\n" "$name" "$desc"
done
[ -n "$short" ] || [ -n "$quiet" ] || echo "Available applications:"
__epm_play_list $psdir
[ -n "$quiet" ] || [ -n "$*" ] && exit
echo
#echo "Run epm play --help for help"
......
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