diff options
-rwxr-xr-x | bl | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -161,12 +161,12 @@ get_raw_new() { done case "$op" in - +) : $(( new = curr + val )) ;; - -) : $(( new = curr - val )) ;; + "+") : $(( new = curr + val )) ;; + "-") : $(( new = curr - val )) ;; "") : $(( new = val )) ;; - =+) : $(( raw_new = raw_curr + val )) ;; - =-) : $(( raw_new = raw_curr - val )) ;; - =) : $(( raw_new = val )) ;; + "=+") : $(( raw_new = raw_curr + val )) ;; + "=-") : $(( raw_new = raw_curr - val )) ;; + "=") : $(( raw_new = val )) ;; *) printf "invalid operator '%s'\n" "$op" >&2 exit 2 @@ -256,14 +256,14 @@ main() { op="${1:-}" case "$op" in "") printf "%d\n" "$curr" ;; - +[0-9]*) set_brightness + "${op#+}" ;; - -[0-9]*) set_brightness - "${op#-}" ;; + "+"[0-9]*) set_brightness + "${op#+}" ;; + "-"[0-9]*) set_brightness - "${op#-}" ;; [0-9]*) set_brightness "" "$op" ;; - =) printf "%d\n" "$raw_curr" ;; + "=") printf "%d\n" "$raw_curr" ;; "="+[0-9]*) set_brightness "=+" "${op#=+}" ;; - #+=[0-9]*) set_brightness "=+" "${op#+=}" ;; + #"+="[0-9]*) set_brightness "=+" "${op#+=}" ;; "="-[0-9]*) set_brightness "=-" "${op#=-}" ;; - #-=[0-9]*) set_brightness "=-" "${op#-=}" ;; + #"-="[0-9]*) set_brightness "=-" "${op#-=}" ;; "="[0-9]*) set_brightness "=" "${op#=}" ;; *) printf "invalid operator: '%s'\n" "$op" >&2 |