diff options
| author | Horus3 | 2014-03-11 01:39:02 +0100 |
|---|---|---|
| committer | Horus3 | 2014-03-11 01:39:02 +0100 |
| commit | ffc1168f404eebde7ba2c00e2b06eeb03e4d7415 (patch) | |
| tree | aa0c3f6eb2f244e70b4c95330283a0a38ad9c57a /bin/play | |
| parent | 7270bbad833fd1254d556edff236040ac99bee56 (diff) | |
| download | dotfiles-ffc1168f404eebde7ba2c00e2b06eeb03e4d7415.tar.gz | |
-h
Diffstat (limited to 'bin/play')
| -rwxr-xr-x | bin/play | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -7,6 +7,21 @@ # set the exit code right for quitting # 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" + echo "-n don't ask for moving" + echo "-o ask for a different archiv" + 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 @@ -25,6 +40,8 @@ while true; do -d|-download|-down) download="yes" shift ;; + -h|--help) printhelp + ;; *) break ;; esac @@ -74,8 +91,7 @@ if [[ "$@" =~ ^https?://.+\.[a-z]{2}[a-z]* ]]; then wget -q -O "file" "$@" & echo "Starting download. Ready to play in 2 sec." sleep 2 - $player file - rm -v file + mpv file echo "TODO: Moving to archiv. Not implemented yet." exit 0 elif [[ $player =~ mpv$ ]] && [ $download ] && ( [ ! $download = "n" ] && [ ! $download = "N" ] && [ ! $download = "no" ] && [ ! $download = "nein" ] && [ ! $download = "NO" ]); then |
