From e10b808c437740885440c87c043f4f1f83b52fde Mon Sep 17 00:00:00 2001 From: Mark Small Date: Mon, 5 May 2014 21:16:10 +0100 Subject: [PATCH] Add auto-completion for puppet inspect: Provides auto-complete options for puppet inspect sub-command. --- custom/plugins/puppet/_puppet | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/custom/plugins/puppet/_puppet b/custom/plugins/puppet/_puppet index fc283875d..209e0f85b 100644 --- a/custom/plugins/puppet/_puppet +++ b/custom/plugins/puppet/_puppet @@ -267,6 +267,12 @@ _filebucket_arguments=( '--bucket: undocumented action' ) +local -a _inspect_arguments +_inspect_arguments=( + '--archive_files:During an inspect run, whether to archive files whose contents are audited to a file bucket' + '--archive_file_server:During an inspect run, the file bucket server to archive files to if archive_files is set' +) + __task_list () { @@ -516,6 +522,23 @@ __puppet-filebucket () esac } +__puppet-inspect () +{ + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + _describe -t commands "gem subcommand" _inspect_arguments + return + ;; + esac +} + local expl @@ -606,10 +629,15 @@ case $state in __puppet-file ;; - # Display sub-commands for puppet file. + # Display sub-commands for puppet filebucket. (filebucket) __puppet-filebucket ;; + + # Display sub-commands for puppet inspect. + (inspect) + __puppet-inspect + ;; esac ;; esac