Add auto-completion for puppet man:

Provides auto-complete options for puppet man sub-command.
This commit is contained in:
Mark Small 2014-05-05 21:45:53 +01:00
commit 41838d0aaf

View file

@ -350,6 +350,14 @@ _kick_arguments=(
'--ping:Do an ICMP echo against the target host'
)
local -a _man_arguments
_man_arguments=(
'man:Display the manual page for a Puppet subcommand'
'--render-as:FORMAT The rendering format to use'
'--verbose:Whether to log verbosely'
'--debug:Whether to log debug information'
)
__task_list ()
{
@ -701,6 +709,23 @@ __puppet-kick ()
esac
}
__puppet-man ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "gem subcommand" _man_arguments
return
;;
esac
}
local expl
@ -825,6 +850,11 @@ case $state in
(kick)
__puppet-kick
;;
# Display sub-commands for puppet man.
(man)
__puppet-man
;;
esac
;;
esac