2024-07-14 15:14:26 +02:00
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
2023-01-27 23:15:55 +01:00
|
|
|
# created by Tobias Powalowski <tpowa@archlinux.org>
|
2023-06-30 07:30:44 +02:00
|
|
|
_update()
|
2023-01-27 23:15:55 +01:00
|
|
|
{
|
2024-08-01 19:40:14 +02:00
|
|
|
local cur prev OPTS
|
|
|
|
COMPREPLY=()
|
|
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
|
|
case $prev in
|
|
|
|
-*)
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
case $cur in
|
|
|
|
*)
|
|
|
|
OPTS="$(update | rg '\-[a-z]' | choose 0 | sd '\x1B\[[0-9;]*[a-zA-Z]' '')"
|
|
|
|
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
compopt -o bashdefault -o default
|
|
|
|
return 0
|
2023-01-27 23:15:55 +01:00
|
|
|
}
|
2023-06-30 07:30:44 +02:00
|
|
|
complete -F _update update
|