summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/play20
1 files changed, 18 insertions, 2 deletions
diff --git a/bin/play b/bin/play
index 8d480e7..290e99a 100755
--- a/bin/play
+++ b/bin/play
@@ -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