From 13b0153456836b58c612683d75ec14ec8a595757 Mon Sep 17 00:00:00 2001 From: Mark Small Date: Mon, 5 May 2014 22:59:38 +0100 Subject: [PATCH] Add auto-completion for puppet status: Provides auto-complete options for puppet status sub-command. --- custom/plugins/puppet/_puppet | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/custom/plugins/puppet/_puppet b/custom/plugins/puppet/_puppet index 9fbe37e37..5eae7bce3 100644 --- a/custom/plugins/puppet/_puppet +++ b/custom/plugins/puppet/_puppet @@ -470,6 +470,17 @@ _secret_agent_arguments=( '--debug:Whether to log debug information' ) +local -a _status_arguments +_status_arguments=( + 'find:Check status of puppet master server' + 'info:Print the default terminus class for this face' + '--render-as:FORMAT The rendering format to use' + '--verbose:Whether to log verbosely' + '--debug:Whether to log debug information' + '--extra:HASH Extra arguments to pass to the indirection request' + '--terminus: TERMINUS The indirector terminus to use' +) + __task_list () @@ -992,6 +1003,23 @@ __puppet-secret_agent () esac } +__puppet-status () +{ + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + _describe -t commands "gem subcommand" _status_arguments + return + ;; + esac +} + local expl @@ -1166,6 +1194,11 @@ case $state in (secret_agent) __puppet-secret_agent ;; + + # Display sub-commands for puppet status. + (status) + __puppet-status + ;; esac ;; esac