Drop default --noconfirm (opt-in via --noconfirm), fix --noremovemake, forward pacman argv intact for -R/-D/-F/-T/-U, deepen PKGBUILD review, show an install plan before building, and add shellcheck CI plus unit tests. Co-authored-by: Frank Vitrano <WHC2006@users.noreply.github.com>
29 lines
849 B
Bash
29 lines
849 B
Bash
# bash completion for miaur
|
|
_miaur() {
|
|
local cur prev
|
|
COMPREPLY=()
|
|
cur=${COMP_WORDS[COMP_CWORD]}
|
|
prev=${COMP_WORDS[COMP_CWORD - 1]}
|
|
|
|
local ops='-S -Syu -Sua -Ss -Si -Sc -Q -Qua -Qm -R -Rns -G -Gp -B -Bi -h -V'
|
|
local longs='--aur --repo --skipreview --cleanafter --removemake --noremovemake --noremovermake --bottomup --topdown --clonedir --mflags --sudoloop --nosudoloop --noconfirm --help --version'
|
|
|
|
case "$prev" in
|
|
-S | -Si | -Ss | -G | -Gp | -R | -Rns | -Qi)
|
|
COMPREPLY=($(compgen -W "$(pacman -Ssq "^${cur}" 2>/dev/null | head -50)" -- "$cur"))
|
|
return
|
|
;;
|
|
--clonedir)
|
|
COMPREPLY=($(compgen -d -- "$cur"))
|
|
return
|
|
;;
|
|
esac
|
|
|
|
if [[ $cur == -* ]]; then
|
|
COMPREPLY=($(compgen -W "$ops $longs" -- "$cur"))
|
|
else
|
|
COMPREPLY=($(compgen -W "$(pacman -Ssq "^${cur}" 2>/dev/null | head -40)" -- "$cur"))
|
|
fi
|
|
}
|
|
complete -F _miaur miaur
|