Add auto-completion for puppet node:

Provides auto-complete options for puppet node sub-command.
This commit is contained in:
Mark Small 2014-05-05 22:09:25 +01:00
commit 5b354cf280

View file

@ -392,6 +392,18 @@ _module_arguments=(
'--modulepath:$basemodulepath The search path for modules'
)
local -a _node_arguments
_node_arguments=(
'clean:Clean up everything a puppetmaster knows about a node'
'find:Retrieve a node object'
'info:Print the default terminus class for this face'
'--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 ()
@ -795,6 +807,23 @@ __puppet-module ()
esac
}
__puppet-node ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "gem subcommand" _node_arguments
return
;;
esac
}
local expl
@ -934,6 +963,11 @@ case $state in
(module)
__puppet-module
;;
# Display sub-commands for puppet node.
(node)
__puppet-node
;;
esac
;;
esac