From b764a46ded2037749ce340872e2d8aa30bd6fb81 Mon Sep 17 00:00:00 2001 From: Shy Date: Thu, 8 Aug 2024 19:37:55 +0200 Subject: [PATCH] Print usage when called without flags. --- wled | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wled b/wled index b46f8b9..c0e89ff 100755 --- a/wled +++ b/wled @@ -70,10 +70,15 @@ 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) # Missing instance parameter. + -h|--help) print_help exit 0 ;;