From 57aff237c23290037dfb4a08a02d3a5735756cdd Mon Sep 17 00:00:00 2001 From: Mark Small Date: Mon, 5 May 2014 21:42:04 +0100 Subject: [PATCH] Add auto-completion for puppet kick: Provides auto-complete options for puppet kick sub-command. --- custom/plugins/puppet/_puppet | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/custom/plugins/puppet/_puppet b/custom/plugins/puppet/_puppet index 44718ef47..954d95c7a 100644 --- a/custom/plugins/puppet/_puppet +++ b/custom/plugins/puppet/_puppet @@ -328,6 +328,28 @@ _key_arguments=( '--terminus: TERMINUS The indirector terminus to use' ) +local -a _kick_arguments +_kick_arguments=( + '-a:Connect to all available hosts. Requires LDAP support at this point' + '--all:Connect to all available hosts. Requires LDAP support at this point' + '-c: Specify a class of machines to which to connect. This only works if you have LDAP configured, at the moment' + '--class: Specify a class of machines to which to connect. This only works if you have LDAP configured, at the moment' + '-d:Enable full debugging' + '--debug:Enable full debugging' + '-f:Run each configuration in the foreground' + '--foreground:Run each configuration in the foreground' + '-h:Print this help message' + '--help:Print this help message' + '--host: A specific host to which to connect' + '--no-fqdn:undocumented action' + '--ignoreschedules:Whether the client should ignore schedules when running its configuration' + '-t: Specify a tag for selecting the objects to apply' + '--tag: Specify a tag for selecting the objects to apply' + '--test:Print the hosts you would connect to but do not actually connect' + '-p:Do an ICMP echo against the target host' + '--ping:Do an ICMP echo against the target host' +) + __task_list () { @@ -662,6 +684,23 @@ __puppet-key () esac } +__puppet-kick () +{ + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + _describe -t commands "gem subcommand" _kick_arguments + return + ;; + esac +} + local expl @@ -781,6 +820,11 @@ case $state in (key) __puppet-key ;; + + # Display sub-commands for puppet kick. + (kick) + __puppet-kick + ;; esac ;; esac