print debug data to stderr

This commit is contained in:
dtb 2022-09-09 22:14:20 -04:00
parent c8aba752da
commit 2cc10d34ae
1 changed files with 6 additions and 6 deletions

View File

@ -13,13 +13,13 @@ stream_config(){
# check if usage is valid
if ! test -n "$1"; then
printf "Usage: %s [resource...]\n" "$argv0"
printf "Usage: %s [resource...]\n" "$argv0" 1>&2
exit 64 # sysexits(3) EX_USAGE
fi
# check if we have curl(1)
if ! command -v curl >/dev/null 2>&1; then
printf "%s: Missing dependency: curl(1)\n" "$argv0"
printf "%s: Missing dependency: curl(1)\n" "$argv0" 1>&2
exit 71 # sysexits(3) EX_OSERR
fi
@ -36,7 +36,7 @@ if ! test -n "$BROWSER"; then
%s: \$BROWSER not filled.
Please place the path to your default browser's executable in
/etc/xdg-sanity/xdg-sanity.conf
" "$argv0"
" "$argv0" 1>&2
exit 71 # sysexits(3) EX_OSERR
fi
@ -67,10 +67,10 @@ while test -n "$1"; do
if [ "$MIME" = "text/html" ]; then
"$BROWSER" "$argv1"
elif ! handlr launch "$MIME" -- "$argv1"; then
printf "%s: %s: handlr(1) failed: " "$argv0" "$argv1"
printf "%s: %s: handlr(1) failed: " "$argv0" "$argv1" 1>&2
[ "$(command -v handlr)" = "false" ] \
&& printf "'handlr' program not found\n" \
|| printf "non-zero exit status\n"
&& printf "'handlr' program not found\n" 1>&2 \
|| printf "non-zero exit status\n" 1>&2
fi
shift