planime: Added an option to just print the intended file.
authorfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Sat, 16 May 2009 23:44:40 +0000 (23:44 +0000)
committerfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Sat, 16 May 2009 23:44:40 +0000 (23:44 +0000)
git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/utils@1119 959494ce-11ee-0310-bf91-de5d638817bd

planime

diff --git a/planime b/planime
index dfb8d64..5a0f302 100755 (executable)
--- a/planime
+++ b/planime
@@ -56,14 +56,14 @@ findfile() {
 
 origargs=("$0" "$@")
 cmdline=(mplayer -fs -ass)
-unset pretend
+unset pretend printfile
 
 while [ "${1:0:1}" = - ]; do
     a="$1"
     shift
     case "$a" in
        -h)
-           echo "usage: planime [-htC] [-s PAR VAL] [NAME-QUAL] [EP|.] [TYPE-QUAL]" >&2
+           echo "usage: planime [-htCf] [-A PLAYER-ARGS... ;] [-s PAR VAL] [NAME-QUAL] [EP|.] [TYPE-QUAL]" >&2
            exit 0
            ;;
        -t)
@@ -88,6 +88,9 @@ while [ "${1:0:1}" = - ]; do
            saveval="$1"
            shift
            ;;
+       -f)
+           printfile=y
+           ;;
     esac
 done
 
@@ -216,6 +219,8 @@ if [ "`hostname`" = pc6 -o "`hostname`" = pc7 -a "$DISPLAY" = :1 ]; then chwp=y;
 
 if [ -n "$pretend" ]; then
     echo "${cmdline[@]}" "$file"
+elif [ -n "$printfile" ]; then
+    echo "$file"
 else
     if [ "$chwp" = y ]; then (sleep 2; randomwp) & fi
     "${cmdline[@]}" "$file"