Add auto-completion for puppet plugin:

Provides auto-complete options for puppet plugin sub-command.
This commit is contained in:
Mark Small 2014-05-05 22:20:03 +01:00
commit 6dd78d676e

View file

@ -412,6 +412,14 @@ _parser_arguments=(
'--debug:Whether to log debug information'
)
local -a _plugin_arguments
_plugin_arguments=(
'download:Download plugins from the puppet master'
'--render-as:FORMAT The rendering format to use'
'--verbose:Whether to log verbosely'
'--debug:Whether to log debug information'
)
__task_list ()
@ -849,6 +857,23 @@ __puppet-parser ()
esac
}
__puppet-plugin ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "gem subcommand" _plugin_arguments
return
;;
esac
}
local expl
@ -998,6 +1023,11 @@ case $state in
(parser)
__puppet-parser
;;
# Display sub-commands for puppet plugin.
(plugin)
__puppet-plugin
;;
esac
;;
esac