diff --git a/shell_completions/zsh/_jenkins b/shell_completions/zsh/_jenkins new file mode 100644 index 0000000..9fe3960 --- /dev/null +++ b/shell_completions/zsh/_jenkins @@ -0,0 +1,37 @@ +#compdef jenkins + + +local -a common_ops +local ret=1 state + +common_ops=( + {-h,--help}'[show this help message and exit]' + '--host[Jenkins Server Url]' + '--username[Jenkins Username]' + '--password[Jenkins Password]' +) + +typeset -A opt_args +_arguments \ + ':cmds:->cmds' \ + $common_ops \ + '*::options:->options' && ret=0 + +case "$state" in + (cmds) + local commands; + commands=( + 'jobs:Show all jobs and their status' + 'queue:Shows builds queue' + 'building:Build executor status' + 'start:Start job' + 'info:Job info' + 'set_branch:Set branch' + 'stop:Stop job' + 'console:Show job history' + ) + _describe -t commands 'jenkins command' commands && ret=0 + ;; +esac + +return ret