mirror of
https://github.com/alexanderepstein/Bash-Snippets
synced 2018-11-08 02:59:35 +01:00
Adding script exit after successfull run
This commit is contained in:
parent
0b38f94cae
commit
5f2482179f
@ -44,7 +44,7 @@ Provides a way to watch youtube videos from the terminal.
|
|||||||
|
|
||||||
You can use ```ytview -c [channel name]``` to see recent videos by that artist.
|
You can use ```ytview -c [channel name]``` to see recent videos by that artist.
|
||||||
|
|
||||||
You can use ```youtubeviewer -s '[videoToSearch]'``` to search for videos.
|
You can use ```ytview -s [videoToSearch]``` or just ```ytview [videoToSearch]``` to search for videos.
|
||||||
|
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
|
@ -190,7 +190,7 @@ do
|
|||||||
search=$(printf '%s ' "$@")
|
search=$(printf '%s ' "$@")
|
||||||
flag="search"
|
flag="search"
|
||||||
else
|
else
|
||||||
echo "Error: search and channel options are mutually exclusive"
|
echo "Error: search and channel options are mutually exclusive" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
@ -199,22 +199,25 @@ do
|
|||||||
channel="$OPTARG"
|
channel="$OPTARG"
|
||||||
flag="channel"
|
flag="channel"
|
||||||
else
|
else
|
||||||
echo "Error: search and channel options are mutually exclusive"
|
echo "Error: search and channel options are mutually exclusive" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
h) usage ;;
|
h) usage && exit 0 ;;
|
||||||
u) update ;;
|
u) update && exit 0 ;;
|
||||||
*) usage ;;
|
*) usage && exit 0 ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ $# == "0" ]]; then
|
if [[ $# == "0" ]]; then
|
||||||
usage
|
usage
|
||||||
|
exit 0
|
||||||
elif [[ $1 == "help" ]];then
|
elif [[ $1 == "help" ]];then
|
||||||
usage
|
usage
|
||||||
|
exit 0
|
||||||
elif [[ $1 == "update" ]]; then
|
elif [[ $1 == "update" ]]; then
|
||||||
update
|
update
|
||||||
|
exit 0
|
||||||
elif [[ $flag == "search" ]]; then
|
elif [[ $flag == "search" ]]; then
|
||||||
searchview || exit 1
|
searchview || exit 1
|
||||||
elif [[ $flag == "channel" ]]; then
|
elif [[ $flag == "channel" ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user