Commit Diff


commit - 68de62e15283b1f03fb32c3c19b55a52719704ff
commit + 0952df4dba1fa6bfa901a43dbe2f173d9c1bd5f7
blob - e70ecaba22fdd7f7d22d7d3d0d5924397b08f0df
blob + 29fb3abfe8be343c3793cab793729d60c54f1e4d
--- statbarctl.sh
+++ statbarctl.sh
@@ -2,16 +2,36 @@
 
 STATBARCMD=~/.local/state/statbarcmd
 
+show_help()
+{
+	echo "statbarctl help"
+	echo "\nstatbarctl is used to control aspects of a running statbar instance"
+	echo "statbar must be running for this program to be useful"
+	echo "\nUsage:"
+	echo "\tstatbarctl reload-weather: refresh the weather module"
+	echo "\tstatbarctl reload-mail: refresh the mail module"
+	echo "\tstatbarctl reload-battery: refresh the battery module"
+	echo "\tstatbarctl help: show this message"
+}
+
 if [ ! -p "$STATBARCMD" ]; then
 	echo "Could not open statbar command interface" > /dev/stderr
 	exit 1;
 fi
 
+if [ -z "$1" ]; then
+	show_help;
+	exit 0;
+fi
+
 case "$1" in
-	reload-config) CMDBYTE="\x01" ;;
 	reload-weather) CMDBYTE="\x02" ;;
 	reload-mail) CMDBYTE="\x03" ;;
 	reload-battery) CMDBYTE="\x04" ;;
+	help)
+		show_help
+		exit 0;
+	;;
 	*)
 		printf "Unknown command: %s\n" "$1" > /dev/stderr
 		exit 1