From f8bb69594c86e69015247335e68a3062457ae532 Mon Sep 17 00:00:00 2001 From: Shy Date: Wed, 7 Aug 2024 20:46:57 +0200 Subject: [PATCH] More extensive documentation of sed script. --- wled | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/wled b/wled index 00b1fe8..d61f3e1 100755 --- a/wled +++ b/wled @@ -134,11 +134,15 @@ for wled_host in $host_list; do printf "loading ...\r" active_ps=$(active_preset "$wled_host") curl_fetch "http://$wled_host/presets.json" | \ - # Insert newlines in front of every preset. - # Extract number and name of every preset. + # Insert newline in front of every preset slice. + # (Start of loop.) + # Match number and name of first preset. + # Replace in number: name format. # Match and mark active preset. - # Right-align numbers. - # Print up to next newline, delete up to next newline. + # Right-align number. + # Print out up to next newline. + # Delete up to next newline. + # Process next preset or end of loop. # Prepend description. sed --sandbox -n ' s/"1\?[0-9]"[[:space:]]*:/\n&/g