zsh-completion: add bootctl

This commit is contained in:
Marko Myllynen
2014-02-23 12:41:50 +00:00
committed by Colin Guthrie
parent 4daec5fdd0
commit f262a262c8
2 changed files with 29 additions and 0 deletions
+4
View File
@@ -1743,6 +1743,10 @@ bootctl_LDADD = \
bin_PROGRAMS += \
bootctl
dist_zshcompletion_DATA += \
shell-completion/zsh/_bootctl
endif
# ------------------------------------------------------------------------------
+25
View File
@@ -0,0 +1,25 @@
#compdef bootctl
(( $+functions[_bootctl_command] )) || _bootctl_command()
{
local -a _bootctl_cmds
_bootctl_cmds=(
"status:Show current firmware and boot settings"
)
if (( CURRENT == 1 )); then
_describe -t commands 'bootctl command' _bootctl_cmds || compadd "$@"
else
local curcontext="$curcontext"
cmd="${${_bootctl_cmds[(r)$words[1]:*]%%:*}}"
if (( $+functions[_bootctl_$cmd] )); then
_bootctl_$cmd
else
_message "no more options"
fi
fi
}
_arguments \
{-h,--help}'[Prints a short help text and exits.]' \
'--version[Prints a short version string and exits.]' \
'*::bootctl command:_bootctl_command'