about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xbollux9
1 files changed, 5 insertions, 4 deletions
diff --git a/bollux b/bollux index b63e645..b9d1443 100755 --- a/bollux +++ b/bollux
@@ -45,7 +45,7 @@ END_USAGE
45 45
46### utility functions ### 46### utility functions ###
47# a better echo 47# a better echo
48put() { printf '%s\n' "$*" >&3; } 48put() { printf '%s\n' "$*"; }
49 49
50# conditionally log events to stderr 50# conditionally log events to stderr
51# lower = more important 51# lower = more important
@@ -91,7 +91,7 @@ die() { # die [EXIT-CODE] MESSAGE
91ask() { # ask PROMPT [READ_OPT...] 91ask() { # ask PROMPT [READ_OPT...]
92 prompt="$1" 92 prompt="$1"
93 shift 93 shift
94 read -e -r -u 3 -p "$prompt> " "$@" 94 read </dev/tty -e -r -p "$prompt> " "$@"
95} 95}
96 96
97# fail if something isn't installed 97# fail if something isn't installed
@@ -271,8 +271,9 @@ download() { # download URL < FILE
271 271
272### main entry point ### 272### main entry point ###
273bollux() { 273bollux() {
274 # use &3 for user input 274 OPTIND=0
275 exec 3<>/dev/tty 275 process_cmdline "$@"
276 shift $((OPTIND - 1))
276 277
277 if (($# == 1)); then 278 if (($# == 1)); then
278 URL="$1" 279 URL="$1"