#compdef backup-setup # ZSH completion for backup-setup # Installation: Copy to /usr/local/share/zsh/site-functions/_backup-setup _backup-setup() { local -a commands backup_types commands=( 'status:Show backup status and last backup time' 'backup:Trigger a backup' 'list:List available backups on NAS' 'logs:View recent backup logs' 'test:Test NAS connection' 'help:Show help message' ) backup_types=( 'full:Full system backup (excludes caches, tmp, build dirs)' 'home:Home directory backup only' 'incremental:Incremental backup (space-efficient)' 'configs:Configuration files backup (lightweight)' ) _arguments -C \ '1:command:->command' \ '2:backup-type:->backup_type' \ && return 0 case $state in command) _describe -t commands 'backup-setup command' commands ;; backup_type) if [[ ${words[2]} == "backup" ]]; then _describe -t backup_types 'backup type' backup_types fi ;; esac return 0 } _backup-setup "$@"