Add auto-completion for puppet key:

Provides auto-complete options for puppet key sub-command.
This commit is contained in:
Mark Small 2014-05-05 21:30:55 +01:00
commit 523554e691

View file

@ -314,6 +314,20 @@ _instrumentation_probe_arguments=(
'--terminus: TERMINUS The indirector terminus to use'
)
local -a _key_arguments
_key_arguments=(
'destroy:Delete an object'
'find:Retrieve an object by name'
'info:Print the default terminus class for this face'
'save:API only: create or overwrite an object'
'search:Search for an object or retrieve multiple objects'
'--render-as:FORMAT The rendering format to use'
'--verbose:Whether to log verbosely'
'--debug:Whether to log debug information'
'--extra:HASH Extra arguments to pass to the indirection request'
'--terminus: TERMINUS The indirector terminus to use'
)
__task_list ()
{
@ -631,6 +645,23 @@ __puppet-instrumentation_probe ()
esac
}
__puppet-key ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "gem subcommand" _key_arguments
return
;;
esac
}
local expl
@ -745,6 +776,11 @@ case $state in
(instrumentation_probe)
__puppet-instrumentation_probe
;;
# Display sub-commands for puppet key.
(key)
__puppet-key
;;
esac
;;
esac