]> git.ipfire.org Git - thirdparty/systemd.git/blame - shell-completion/zsh/_bootctl
shell-completion/zsh: add -*type*- headers
[thirdparty/systemd.git] / shell-completion / zsh / _bootctl
CommitLineData
c1072f64 1#compdef bootctl -*- shell-script -*-
7059062c 2# SPDX-License-Identifier: LGPL-2.1+
51d0f1c9 3
c501ecd7 4(( $+functions[_bootctl_commands] )) || _bootctl_commands()
51d0f1c9
MM
5{
6 local -a _bootctl_cmds
7 _bootctl_cmds=(
da090dfd 8 "status:Show status of installed systemd-boot and EFI variables"
c521a430 9 "install:Install systemd-boot to the ESP and EFI variables"
da090dfd
RC
10 "update:Update systemd-boot in the ESP and EFI variables"
11 "remove:Remove systemd-boot from the ESP and EFI variables"
51d0f1c9
MM
12 )
13 if (( CURRENT == 1 )); then
14 _describe -t commands 'bootctl command' _bootctl_cmds || compadd "$@"
15 else
16 local curcontext="$curcontext"
17 cmd="${${_bootctl_cmds[(r)$words[1]:*]%%:*}}"
18 if (( $+functions[_bootctl_$cmd] )); then
19 _bootctl_$cmd
20 else
21 _message "no more options"
22 fi
23 fi
24}
25
26_arguments \
27 {-h,--help}'[Prints a short help text and exits.]' \
28 '--version[Prints a short version string and exits.]' \
da090dfd
RC
29 '--path=[Path to the EFI System Partition (ESP)]:path:_directories' \
30 '--no-variables[Do not touch EFI variables]' \
c501ecd7 31 '*::bootctl command:_bootctl_commands'