From fd1cfa64327013f7e78818f12feca522c20ace10 Mon Sep 17 00:00:00 2001 From: Mark Small Date: Mon, 5 May 2014 22:56:57 +0100 Subject: [PATCH] Add auto-completion for puppet secret_agent: Provides auto-complete options for puppet secret_agent sub-command. --- custom/plugins/puppet/_puppet | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/custom/plugins/puppet/_puppet b/custom/plugins/puppet/_puppet index f2ad25ed9..9fbe37e37 100644 --- a/custom/plugins/puppet/_puppet +++ b/custom/plugins/puppet/_puppet @@ -462,6 +462,14 @@ _resource_type_arguments=( '--terminus: TERMINUS The indirector terminus to use' ) +local -a _secret_agent_arguments +_secret_agent_arguments=( + 'synchronize:Run secret_agent once' + '--render-as:FORMAT The rendering format to use' + '--verbose:Whether to log verbosely' + '--debug:Whether to log debug information' +) + __task_list () @@ -967,6 +975,23 @@ __puppet-resource_type () esac } +__puppet-secret_agent () +{ + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + _describe -t commands "gem subcommand" _secret_agent_arguments + return + ;; + esac +} + local expl @@ -1136,6 +1161,11 @@ case $state in (resource_type) __puppet-resource_type ;; + + # Display sub-commands for puppet secret_agent. + (secret_agent) + __puppet-secret_agent + ;; esac ;; esac