From b907b0852e3958b982b43f63b7513df73e6d5df3 Mon Sep 17 00:00:00 2001 From: Horus3 Date: Tue, 11 Mar 2014 01:53:43 +0100 Subject: fixed bug --- bin/play | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bin/play b/bin/play index 290e99a..6893d53 100755 --- a/bin/play +++ b/bin/play @@ -8,6 +8,7 @@ # echo "q quit 255" >> ~/.mpv/input.conf printhelp(){ + echo "Bash script to play and cache files from a slow network ressource" echo "" echo "-y move to archiv without question" @@ -16,13 +17,10 @@ printhelp(){ echo "-r only remove the file in /tmp" echo "-d don't ask for downloading" echo "-h prints this help" + exit 0 } -if [ $# -eq 0 ]; then - printhelp -fi - while true; do case "$1" in -y|-Y|-yes|-j|-ja) verify="yes" @@ -34,7 +32,7 @@ while true; do -o|-other|-ot) verify="other" shift ;; - -n|-no|-nope|-nein) verify= + -n|-no|-nope|-nein) verify="no" shift ;; -d|-download|-down) download="yes" @@ -47,6 +45,10 @@ while true; do esac done +if [ $# -eq 0 ]; then + printhelp +fi + player[0]=$(command -v mpv) #media player of choice player[1]=$(command -v mplayer) player[2]=$(command -v vlc) #you shouldn't use vlc -- cgit v1.2.3