mirror of
https://github.com/endeavouros-team/eos-pkgbuild-setup.git
synced 2026-06-13 01:54:36 +00:00
41 lines
1.1 KiB
Bash
41 lines
1.1 KiB
Bash
# bash completion for assets.make -*- shell-script -*-
|
|
|
|
_assets_make_complete_simple() {
|
|
COMPREPLY=($(compgen -W "$1" -- "$cur"))
|
|
[[ $COMPREPLY == *= ]] && compopt -o nospace
|
|
}
|
|
|
|
_assets_make_complete_open() {
|
|
COMPREPLY=($(compgen "$@"))
|
|
[[ $COMPREPLY == *= ]] && compopt -o nospace
|
|
}
|
|
|
|
_assets_make_() {
|
|
local cur prev #words cword split
|
|
_init_completion -s || return
|
|
|
|
local -r opts="$(assets.make --dump-options)"
|
|
|
|
# Handle options that need sub-options.
|
|
# Each option "case" should return immediately.
|
|
|
|
case "$prev" in
|
|
--fetch-timeout)
|
|
_assets_make_complete_open -P "$cur" -W "{0..9}"
|
|
;;
|
|
*)
|
|
# Handle all top-level parameters.
|
|
case "$cur" in
|
|
-* | "")
|
|
# Any option or nothing yet.
|
|
_assets_make_complete_simple "$opts"
|
|
;;
|
|
*)
|
|
# Non-option parameters.
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
} &&
|
|
complete -F _assets_make_ assets.make
|