diff options
author | clsr <clsr@clsr.net> | 2023-01-02 10:35:54 +0000 |
---|---|---|
committer | clsr <clsr@clsr.net> | 2023-01-02 10:35:54 +0000 |
commit | cd19cf5cd6caaeea9fd19ddcd1cad4638d796133 (patch) | |
tree | 8d32146d909bac07a9f28e8d04a26d59e1d6efdb | |
parent | 3649b955c0a91494c391278f63e218dea19d12d1 (diff) | |
download | bl-cd19cf5cd6caaeea9fd19ddcd1cad4638d796133.tar.gz bl-cd19cf5cd6caaeea9fd19ddcd1cad4638d796133.zip |
Fix = in zshv3
-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 |