#compdef battery-setup # ZSH completion for battery-setup # Place this file in /usr/local/share/zsh/site-functions/_battery-setup _battery-setup() { local curcontext="$curcontext" state line typeset -A opt_args _arguments -C \ '1: :->command' \ '2: :->arg1' \ '3: :->arg2' \ && return 0 case $state in command) local -a commands commands=( 'status:Show current battery status' 'conservation:Enable conservation mode (20-80%)' 'full:Enable full charge mode (0-100%)' 'custom:Set custom charge thresholds' 'help:Show help information' ) _describe -t commands 'battery-setup command' commands ;; arg1) case $line[1] in custom) _message 'Start threshold (0-100)' ;; esac ;; arg2) case $line[1] in custom) _message 'End threshold (0-100)' ;; esac ;; esac return 0 } _battery-setup "$@"