Add auto-completion for puppet report:

Provides auto-complete options for puppet report sub-command.
This commit is contained in:
Mark Small 2014-05-05 22:37:48 +01:00
commit 714da4218b

View file

@ -420,6 +420,18 @@ _plugin_arguments=(
'--debug:Whether to log debug information'
)
local -a _report_arguments
_report_arguments=(
'info:Print the default terminus class for this face'
'save:API only: submit a report'
'submit:API only: submit a report with error handling'
'--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 ()
@ -874,6 +886,23 @@ __puppet-plugin ()
esac
}
__puppet-report ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "gem subcommand" _report_arguments
return
;;
esac
}
local expl
@ -1028,6 +1057,11 @@ case $state in
(plugin)
__puppet-plugin
;;
# Display sub-commands for puppet report.
(report)
__puppet-report
;;
esac
;;
esac