From b7fddb6c28ae321dcafcd4d5611cce6e0e61a38e Mon Sep 17 00:00:00 2001 From: Mark Small Date: Mon, 5 May 2014 20:20:29 +0100 Subject: [PATCH] Add auto-completion for puppet filebucket: Provides auto-complete options for puppet filebucket sub-command. --- custom/plugins/puppet/_puppet | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/custom/plugins/puppet/_puppet b/custom/plugins/puppet/_puppet index 7a37e978d..fc283875d 100644 --- a/custom/plugins/puppet/_puppet +++ b/custom/plugins/puppet/_puppet @@ -247,6 +247,26 @@ _file_arguments=( '--terminus: TERMINUS The indirector terminus to use' ) +local -a _filebucket_arguments +_filebucket_arguments=( + '-h:Print this help message' + '--help:Print this help message' + '-V:Print version information' + '--version:Print version information' + '-d:Enable full debugging' + '--debug:Enable full debugging' + '-v:Print extra information' + '--verbose:Print extra information' + '-l:Use the local filebucket' + '--local:Use the local filebucket' + '-r:Use a remote filebucket' + '--remote:Use a remote filebucket' + '-s: The server to send the file to, instead of locally' + '-server: The server to send the file to, instead of locally' + '-b: undocumented action' + '--bucket: undocumented action' +) + __task_list () { @@ -479,6 +499,23 @@ __puppet-file () esac } +__puppet-filebucket () +{ + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + _describe -t commands "gem subcommand" _filebucket_arguments + return + ;; + esac +} + local expl @@ -568,6 +605,11 @@ case $state in (file) __puppet-file ;; + + # Display sub-commands for puppet file. + (filebucket) + __puppet-filebucket + ;; esac ;; esac