local i verb comps
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
local -A OPTS=(
- [STANDALONE]='-h --help --no-variables -p --print-esp-path -x --print-boot-path --version --no-pager'
+ [STANDALONE]='-h --help -p --print-esp-path -x --print-boot-path --version --no-variables --no-pager --graceful'
[ARG]='--esp-path --boot-path'
)
fi
local -A VERBS=(
- [STANDALONE]='help install list remove status update'
+ # systemd-efi-options takes an argument, but it is free-form, so we cannot complete it
+ [STANDALONE]='help status install update remove is-installed random-seed systemd-efi-options list'
[BOOTENTRY]='set-default set-oneshot'
+ [BOOLEAN]='reboot-to-firmware'
)
for ((i=0; i < COMP_CWORD; i++)); do
else
comps=''
fi
+ elif __contains_word "$verb" ${VERBS[BOOLEAN]}; then
+ comps="yes no"
fi
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
_bootctl_comp_ids
}
+_bootctl_reboot-to-firmware() {
+ local -a _completions
+ _completions=( yes no )
+ typeset -U _completions
+ _describe 'possible values' _completions
+}
+
(( $+functions[_bootctl_commands] )) || _bootctl_commands()
{
local -a _bootctl_cmds
"install:Install systemd-boot to the ESP and EFI variables"
"update:Update systemd-boot in the ESP and EFI variables"
"remove:Remove systemd-boot from the ESP and EFI variables"
- "random-seed:Initialize random seed in ESP and EFI variables"
"is-installed:Test whether systemd-boot is installed in the ESP"
+ "random-seed:Initialize random seed in ESP and EFI variables"
+ "systemd-efi-options:Query or set system options string in EFI variable"
+ "reboot-to-firmware:Query or set reboot-to-firmware EFI flag"
+ "list:List boot loader entries"
"set-default:Set the default boot loader entry"
"set-oneshot:Set the default boot loader entry only for the next boot"
)
{-x,--print-boot-path}'[Print path to the $BOOT partition]' \
'--no-variables[Do not touch EFI variables]' \
'--no-pager[Do not pipe output into a pager]' \
+ '--graceful[Do not fail when locating ESP or writing fails]' \
'*::bootctl command:_bootctl_commands'