default to usage on bad arguments, require no args to run

fixup
This commit is contained in:
2021-05-04 19:59:42 -05:00
parent 4fd4316e51
commit df1d74b2fc

39
subs
View File

@@ -15,7 +15,7 @@
: "${SUBS:=${XDG_CACHE_HOME:-~/.cache}/subs}" : "${SUBS:=${XDG_CACHE_HOME:-~/.cache}/subs}"
: "${SUBS_LINKS:=$SUBS/links}" : "${SUBS_LINKS:=$SUBS/links}"
: "${SUBS_CACHE:=$SUBS/cache}" : "${SUBS_CACHE:=$SUBS/cache}"
: "${SUBS_SLEEP_VALUE:=0.1}" # raise this if you experience problems : "${SUBS_SLEEP_VALUE:=0.25}" # raise this if you experience problems
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SEP=^^^^^ # shouldn't need to change this SEP=^^^^^ # shouldn't need to change this
# -/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/ # -/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/
@@ -242,23 +242,34 @@ daemonize() {
main() { main() {
mkdir -p "$SUBS" mkdir -p "$SUBS"
if [ "$1" ] ; then
case ${1#-} in case ${1#-} in
n) g)
DONT_PLAY=true gen_links
;;
u)
update_subs
;;
c)
cat_subs
;;
d)
daemonize
;; ;;
m) m)
export MPV_OPTS="$MPV_OPTS --no-video" MPV_OPTS="$MPV_OPTS --no-video" \
shift get_sel
esac ;;
n)
case ${1#-} in DONT_PLAY=true \
h) usage ;; get_sel
g) gen_links ;; ;;
u) update_subs ;; *)
c) cat_subs ;; usage
d) daemonize ;;
*) get_sel
esac esac
else
get_sel
fi
} }
main "$@" main "$@"