Add auto-completion for puppet catalog:

Provides auto-complete options for puppet catalog sub-command.
This commit is contained in:
Mark Small 2014-05-04 23:26:44 +01:00
commit d306e2fc27

View file

@ -105,6 +105,19 @@ _ca_arguments=(
'verify:undocumented action'
)
local -a _catalog_arguments
_catalog_arguments=(
'apply:Find and apply a catalog'
"download:Download this node's catalog from the puppet master server"
'find:Retrieve the catalog for a node'
'info:Print the default terminus class for this face'
'save:API only: create or overwrite an object'
'select:Retrieve a catalog and filter it for resources of a given type'
'--render-as:FORMAT The rendering format to use'
'--verbose:Whether to log verbosely'
'--debug:Whether to log debug information'
)
__task_list ()
{
local expl
@ -166,6 +179,23 @@ __puppet-ca ()
esac
}
__puppet-catalog ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "gem subcommand" _catalog_arguments
return
;;
esac
}
local expl
@ -205,6 +235,11 @@ case $state in
(ca)
__puppet-ca
;;
# Display sub-commands for puppet catalog.
(catalog)
__puppet-catalog
;;
esac
;;
esac