]> git.ipfire.org Git - thirdparty/systemd.git/blob - shell-completion/zsh/_bootctl
0ffef94e4ab3004f096a2e37c3a21cf40813e33a
[thirdparty/systemd.git] / shell-completion / zsh / _bootctl
1 #compdef bootctl
2 # SPDX-License-Identifier: LGPL-2.1+
3
4 (( $+functions[_bootctl_commands] )) || _bootctl_commands()
5 {
6 local -a _bootctl_cmds
7 _bootctl_cmds=(
8 "status:Show status of installed systemd-boot and EFI variables"
9 "install:Install systemd-boot to the ESP and EFI variables"
10 "update:Update systemd-boot in the ESP and EFI variables"
11 "remove:Remove systemd-boot from the ESP and EFI variables"
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.]' \
29 '--path=[Path to the EFI System Partition (ESP)]:path:_directories' \
30 '--no-variables[Do not touch EFI variables]' \
31 '*::bootctl command:_bootctl_commands'