From 34acea979a52466679d15b52109be66f23421189 Mon Sep 17 00:00:00 2001 From: Shy Date: Tue, 6 Aug 2024 19:11:38 +0200 Subject: [PATCH] Rephrased some documentation and help messages. --- README.md | 2 +- wled | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8a13147..4a81929 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Switch on/off: Switch between presets 1 to 17 or list available presets: -`$ wled -f|-w|-a [1-17|l(ist)]` +`$ wled -f|-w|-a 1-17|l(ist)` Display or change brightness: diff --git a/wled b/wled index 8a7c5d8..d40f8f9 100755 --- a/wled +++ b/wled @@ -16,26 +16,26 @@ VERSION="0.1.3" print_usage() { echo "\ -Usage: $COMMAND -f(norcenter)|-w(wohnzimmer)|-a(ll) [on|off] - $COMMAND -f|-w|-a [1-17|list] +Usage: $COMMAND -f(norcenter)|-w(wohnzimmer)|-a(ll) on|off + $COMMAND -f|-w|-a 1-17|list $COMMAND -f|-w|-a -b [1-255]" } print_help() { print_usage echo " -instance selection: +Instance selection: -f,--fnordcenter select fnordcenter -w,--wohnzimmer select wohnzimmer -a,--all select all known instances -commands: +Commands: on|off switch on/off - [1-17] switch preset + 1-17 switch preset l, list list presets -b,--brightness [1-255] get or set brightness -exit status: +Exit status: 0 no failure 1 operating error 2 child command error @@ -114,7 +114,7 @@ for wled_host; do -b|--brightness) # Set brightness. if test -z "$arg_param"; then # No parameter given. Print current brightness. - echo "Current brightness of $wled_host:" + echo "Brightness of $wled_host:" current_brightness "$wled_host" else # Try to convert 3rd parameter to an integer between 1 an 255. @@ -174,7 +174,7 @@ for wled_host; do # Check API response. if test -n "$api_resp" && echo "$api_resp" | grep -qv '{\s*"success"\s*:\s*true\s*}'; then - echo "Warning: unexpected response from WLED API." >&2 + echo "Error: unexpected response from WLED API." >&2 exit_code=$((exit_code|4)) fi done