### utility functions ###
# a better echo
-put() { printf '%s\n' "$*" >&3; }
+put() { printf '%s\n' "$*"; }
# conditionally log events to stderr
# lower = more important
ask() { # ask PROMPT [READ_OPT...]
prompt="$1"
shift
- read -e -r -u 3 -p "$prompt> " "$@"
+ read </dev/tty -e -r -p "$prompt> " "$@"
}
# fail if something isn't installed
### main entry point ###
bollux() {
- # use &3 for user input
- exec 3<>/dev/tty
+ OPTIND=0
+ process_cmdline "$@"
+ shift $((OPTIND - 1))
if (($# == 1)); then
URL="$1"