Add auto-completion for puppet config:

Provides auto-complete options for puppet config sub-command.
This commit is contained in:
Mark Small 2014-05-05 19:23:45 +01:00
commit eaae32d0c3

View file

@ -170,6 +170,16 @@ _certificate_revocation_list_arguments=(
'--terminus: TERMINUS The indirector terminus to use'
)
local -a _config_arguments
_config_arguments=(
"print:Examine Puppet's current settings"
"set:Set Puppet's settings"
'--render-as:FORMAT The rendering format to use'
'--verbose:Whether to log verbosely'
'--debug:Whether to log debug information'
'--section:SECTION_NAME The section of the configuration file to interact with'
)
__task_list ()
{
local expl
@ -299,6 +309,23 @@ __puppet-certificate_revocation_list ()
esac
}
__puppet-config ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "gem subcommand" _config_arguments
return
;;
esac
}
local expl
@ -358,6 +385,11 @@ case $state in
(certificate_revocation_list)
__puppet-certificate_revocation_list
;;
# Display sub-commands for puppet config.
(config)
__puppet-config
;;
esac
;;
esac