Rephrased some documentation and help messages.

This commit is contained in:
Shy 2024-08-06 19:11:38 +02:00
parent 23ce17cb70
commit 34acea979a
2 changed files with 9 additions and 9 deletions

View file

@ -11,7 +11,7 @@ Switch on/off:
Switch between presets 1 to 17 or list available presets: 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: Display or change brightness:

16
wled
View file

@ -16,26 +16,26 @@ VERSION="0.1.3"
print_usage() { print_usage() {
echo "\ echo "\
Usage: $COMMAND -f(norcenter)|-w(wohnzimmer)|-a(ll) [on|off] Usage: $COMMAND -f(norcenter)|-w(wohnzimmer)|-a(ll) on|off
$COMMAND -f|-w|-a [1-17|list] $COMMAND -f|-w|-a 1-17|list
$COMMAND -f|-w|-a -b [1-255]" $COMMAND -f|-w|-a -b [1-255]"
} }
print_help() { print_help() {
print_usage print_usage
echo " echo "
instance selection: Instance selection:
-f,--fnordcenter select fnordcenter -f,--fnordcenter select fnordcenter
-w,--wohnzimmer select wohnzimmer -w,--wohnzimmer select wohnzimmer
-a,--all select all known instances -a,--all select all known instances
commands: Commands:
on|off switch on/off on|off switch on/off
[1-17] switch preset 1-17 switch preset
l, list list presets l, list list presets
-b,--brightness [1-255] get or set brightness -b,--brightness [1-255] get or set brightness
exit status: Exit status:
0 no failure 0 no failure
1 operating error 1 operating error
2 child command error 2 child command error
@ -114,7 +114,7 @@ for wled_host; do
-b|--brightness) # Set brightness. -b|--brightness) # Set brightness.
if test -z "$arg_param"; then if test -z "$arg_param"; then
# No parameter given. Print current brightness. # No parameter given. Print current brightness.
echo "Current brightness of $wled_host:" echo "Brightness of $wled_host:"
current_brightness "$wled_host" current_brightness "$wled_host"
else else
# Try to convert 3rd parameter to an integer between 1 an 255. # Try to convert 3rd parameter to an integer between 1 an 255.
@ -174,7 +174,7 @@ for wled_host; do
# Check API response. # Check API response.
if test -n "$api_resp" && echo "$api_resp" | grep -qv '{\s*"success"\s*:\s*true\s*}'; then 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)) exit_code=$((exit_code|4))
fi fi
done done