Add auto-completion for puppet describe:

Provides auto-complete options for puppet describe sub-command.
This commit is contained in:
Mark Small 2014-05-05 19:37:12 +01:00
commit 0b0593a22d

View file

@ -180,6 +180,15 @@ _config_arguments=(
'--section:SECTION_NAME The section of the configuration file to interact with'
)
local -a _describe_arguments
_describe_arguments=(
'--help:Print this help text'
'--providers:Describe providers in detail for each type'
'--list:List all types'
'--meta:List all metaparameters'
'--short:List only parameters without detail'
)
__task_list ()
{
local expl
@ -326,6 +335,23 @@ __puppet-config ()
esac
}
__puppet-describe ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "gem subcommand" _describe_arguments
return
;;
esac
}
local expl
@ -390,6 +416,11 @@ case $state in
(config)
__puppet-config
;;
# Display sub-commands for puppet describe.
(describe)
__puppet-describe
;;
esac
;;
esac