diff --git a/custom/plugins/puppet/_puppet b/custom/plugins/puppet/_puppet index 61994c1df..5dea58210 100644 --- a/custom/plugins/puppet/_puppet +++ b/custom/plugins/puppet/_puppet @@ -75,6 +75,24 @@ _agent_arguments=( '--waitforcert: This option only matters for daemons that do not yet have certificates' ) +local -a _apply_arguments +_apply_arguments=( + '-h:Print this help message' + '--help:Print this help message' + '-d:Enable full debugging' + '--debug:Enable full debugging' + '-v:Print extra information' + '--verbose:Print extra information' + '-e:Execute a specific piece of Puppet code' + '--execute:Execute a specific piece of Puppet code' + '--detailed-exitcodes:' + '-l:Where to send messages' + '--logdest: Where to send messages' + '--noop:Use "noop" mode where Puppet runs in a no-op or dry-run mode' + '--catalog:: Apply a JSON catalog (such as one generated with "puppet master --compile)"' + '--write-catalog-summary: After compiling the catalog saves the resource list and classes list' +) + __task_list () { local expl @@ -102,6 +120,23 @@ __puppet-agent () esac } +__puppet-apply () +{ + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + _describe -t commands "gem subcommand" _apply_arguments + return + ;; + esac +} + local expl @@ -131,6 +166,11 @@ case $state in (agent) __puppet-agent ;; + + # Display sub-commands for puppet apply. + (apply) + __puppet-apply + ;; esac ;; esac