Add --help and --version actions (#433)

This commit is contained in:
base47
2026-02-12 02:28:55 +01:00
parent 8fb2e4d18d
commit 30a30da9b7

View File

@@ -550,8 +550,14 @@ if [[ $EUID -eq 0 ]]; then
fi
fi
# Version message
if [[ "$action" == "version" ]] || [[ "$action" == "--version" ]]; then
echo "$BATTERY_CLI_VERSION"
exit 0
fi
# Help message
if [ -z "$action" ] || [[ "$action" == "help" ]]; then
if [ -z "$action" ] || [[ "$action" == "help" ]] || [[ "$action" == "--help" ]]; then
echo -e "$helpmessage"
exit 0
fi