Shell cosmetic changes
This commit is contained in:
parent
a444cdcbfd
commit
0f6b0e5133
11 changed files with 66 additions and 61 deletions
14
bin/plumb.sh
14
bin/plumb.sh
|
@ -12,7 +12,7 @@
|
|||
|
||||
usage()
|
||||
{
|
||||
printf "Usage: %s [-T] [URI|file]\n" "${0##*/}">&2
|
||||
printf "Usage: %s [-T] [URI|file]\n" "${0##*/}" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
@ -32,10 +32,8 @@ check_required_program fetch
|
|||
Tflag=
|
||||
while getopts T flag; do
|
||||
case $flag in
|
||||
T) Tflag=-T
|
||||
;;
|
||||
*) usage
|
||||
;;
|
||||
T) Tflag=-T ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
|
@ -55,7 +53,8 @@ case $target in
|
|||
http://* | https://*)
|
||||
file=$(fetch $Tflag "$target") || err "couldn't fetch $target"
|
||||
;;
|
||||
*) [ -f "$target" ] || err "can't handle $uri"
|
||||
*)
|
||||
[ -f "$target" ] || err "can't handle $uri"
|
||||
file=$target
|
||||
;;
|
||||
esac
|
||||
|
@ -84,6 +83,7 @@ video/*)
|
|||
check_required_program mpv
|
||||
mpv "$file"
|
||||
;;
|
||||
*) err "don't know how to open $mimetype"
|
||||
*)
|
||||
err "don't know how to open $mimetype"
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue