diff --git a/wled b/wled index 32c870a..260c8be 100755 --- a/wled +++ b/wled @@ -46,10 +46,10 @@ case "$2" in l|list) echo "Presets on $wled_host:" curl $CURL_FLAGS "http://$wled_host/presets.json" | \ - # Split into lines. One line per preset. - sed --sandbox -n 's/"\([0-9]\{1,2\}\)"/\n"\1"/gp' | \ - # Extract number and name. Append final newline. - sed --sandbox -n 's/^"\([0-9]\{1,2\}\)":.*"n":"\([[:print:]]*\)".*$/\1: \2/p; a\' + # Split into lines - one line per preset. Append final newline. + sed --sandbox 's/"\(1\?[0-9]\)"/\n"\1"/g; $a\' | \ + # Extract number and name of every preset. + sed --sandbox -n 's/^"\(1\?[0-9]\)":.*"n":"\([[:print:]]*\)".*$/\1: \2/p' exit $? ;; dump)