Add auto-completion for puppet resource_type:

Provides auto-complete options for puppet resource_type sub-command.
This commit is contained in:
Mark Small 2014-05-05 22:53:14 +01:00
commit 207ce1ec8a

View file

@ -450,6 +450,18 @@ _resource_arguments=(
'--types:<type>List all available types'
)
local -a _resource_type_arguments
_resource_type_arguments=(
'find:Retrieve info about a resource collection'
'info:Print the default terminus class for this face'
'search:Search for collections matching a regular expression'
'--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 ()
@ -938,6 +950,23 @@ __puppet-resource ()
esac
}
__puppet-resource_type ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "gem subcommand" _resource_type_arguments
return
;;
esac
}
local expl
@ -1102,6 +1131,11 @@ case $state in
(resource)
__puppet-resource
;;
# Display sub-commands for puppet resource_type.
(resource_type)
__puppet-resource_type
;;
esac
;;
esac