lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240820072341.41153-3-rajkumarvad@gmail.com>
Date: Tue, 20 Aug 2024 12:53:41 +0530
From: Rajkumar Vadhyar <rajkumarvad@...il.com>
To: jacek.anaszewski@...il.com,
	rbmarliere@...il.com,
	skhan@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org,
	Rajkumar Vadhyar <rajkumarvad@...il.com>
Subject: [PATCH 2/2] tools/leds: Add '-h' & '--help' cmd options to led_hw_brightness_mon

Add '-h' and '--help' command line options to led_hw_brightness_mon

Signed-off-by: Rajkumar Vadhyar <rajkumarvad@...il.com> 
---
 tools/leds/led_hw_brightness_mon.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/leds/led_hw_brightness_mon.c b/tools/leds/led_hw_brightness_mon.c
index eb65ae988839..712a4f8edb98 100644
--- a/tools/leds/led_hw_brightness_mon.c
+++ b/tools/leds/led_hw_brightness_mon.c
@@ -12,6 +12,7 @@
  * CTRL+C will exit.
  */
 
+#define	USAGE_LED_HW_BRIGHTNESS_MON	"Usage: ./led_hw_brightness_mon <device-name>\n"
 #include <errno.h>
 #include <fcntl.h>
 #include <poll.h>
@@ -36,6 +37,11 @@ int main(int argc, char const *argv[])
 		return 1;
 	}
 
+	if (!(strcmp(argv[1], "-h")) || !(strcmp(argv[1], "--help"))) {
+		fprintf(stderr, USAGE_LED_HW_BRIGHTNESS_MON);
+		return 1;
+	}
+
 	snprintf(brightness_file_path, LED_MAX_NAME_SIZE,
 		 "/sys/class/leds/%s/brightness_hw_changed", argv[1]);
 
-- 
2.40.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ