summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclsr <clsr@clsr.net>2023-01-02 10:35:54 +0000
committerclsr <clsr@clsr.net>2023-01-02 10:35:54 +0000
commitcd19cf5cd6caaeea9fd19ddcd1cad4638d796133 (patch)
tree8d32146d909bac07a9f28e8d04a26d59e1d6efdb
parent3649b955c0a91494c391278f63e218dea19d12d1 (diff)
downloadbl-v3.tar.gz
bl-v3.zip
Fix = in zshv3
-rwxr-xr-xbl20
1 files changed, 10 insertions, 10 deletions
diff --git a/bl b/bl
index 4ebff00..44de5c7 100755
--- a/bl
+++ b/bl
@@ -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