fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#compdef bootctl
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte(( $+functions[_bootctl_command] )) || _bootctl_command()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte{
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte local -a _bootctl_cmds
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte _bootctl_cmds=(
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "status:Show status of installed systemd-boot and EFI variables"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "install:Install systemd-boot to the ESP and EFI variables"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "update:Update systemd-boot in the ESP and EFI variables"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "remove:Remove systemd-boot from the ESP and EFI variables"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte )
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (( CURRENT == 1 )); then
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte _describe -t commands 'bootctl command' _bootctl_cmds || compadd "$@"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte else
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte local curcontext="$curcontext"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte cmd="${${_bootctl_cmds[(r)$words[1]:*]%%:*}}"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (( $+functions[_bootctl_$cmd] )); then
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte _bootctl_$cmd
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte else
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte _message "no more options"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fi
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fi
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte_arguments \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte {-h,--help}'[Prints a short help text and exits.]' \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte '--version[Prints a short version string and exits.]' \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte '--path=[Path to the EFI System Partition (ESP)]:path:_directories' \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte '--no-variables[Do not touch EFI variables]' \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte '*::bootctl command:_bootctl_command'
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte