diff --git a/wled b/wled index 8ed3fab..d61f3e1 100755 --- a/wled +++ b/wled @@ -13,11 +13,6 @@ VERSION="0.1.3" exit_code=0 host_list= -# Shell specific options. -case "$(readlink /proc/$$/exe)" in - */zsh) setopt SH_WORD_SPLIT ;; -esac - # Make the exit status of command pipelines the status of the last command # with non-zero exit status - if supported by this shell. (set -o pipefail 2>/dev/null) && set -o pipefail @@ -75,15 +70,10 @@ current_brightness() { sed -n 's/.*"state"[[:space:]]*:[[:space:]]*{[^}]*"bri"[[:space:]]*:[[:space:]]*\([0-9]\{1,3\}\).*/\1/p' } -if test $# -eq 0; then - print_help - exit 0 -fi - # Parse instance argument and store hostnames. while test $# -gt 0; do case "$1" in - -h|--help) + ""|-h|--help) # Missing instance parameter. print_help exit 0 ;; @@ -141,7 +131,7 @@ for wled_host in $host_list; do api_resp=$(curl_send "{'ps':$1}" "http://$wled_host/json") ;; l|list) # List presets. - test -t 1 && printf 'connecting ...\r' + printf "loading ...\r" active_ps=$(active_preset "$wled_host") curl_fetch "http://$wled_host/presets.json" | \ # Insert newline in front of every preset slice.