Add auto-completion for puppet module:

Provides auto-complete options for puppet module sub-command.
This commit is contained in:
Mark Small 2014-05-05 22:07:16 +01:00
commit cc4294dd45

View file

@ -376,6 +376,22 @@ _master_arguments=(
'--compile:<node-name> Compile a catalogue and output it in JSON from the puppet master'
)
local -a _module_arguments
_module_arguments=(
'build:Build a module release package'
'changes:Show modified files of an installed module'
'generate:Generate boilerplate for a new module'
'install:Install a module from the Puppet Forge or a release archive'
'list:List installed modules'
'search:Search the Puppet Forge for a module'
'uninstall:Uninstall a puppet module'
'upgrade:Upgrade a puppet module'
'-verbose:Whether to log verbosely'
'--debug:Whether to log debug information'
'--environment: production The environment Puppet is running in'
'--modulepath:$basemodulepath The search path for modules'
)
__task_list ()
@ -762,6 +778,23 @@ __puppet-master ()
esac
}
__puppet-module ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "gem subcommand" _module_arguments
return
;;
esac
}
local expl
@ -896,6 +929,11 @@ case $state in
(master)
__puppet-master
;;
# Display sub-commands for puppet module.
(module)
__puppet-module
;;
esac
;;
esac