Files
miaur/completions/miaur.bash
T
Cursor AgentandFrank Vitrano a4f4767c47 Add self-update command to refresh miaur from Git
Introduce `miaur self-update` / `--self-update` that clones RepoUrl@Branch,
detects user vs system install prefix, and reinstalls in place. Configurable
via conf/env; supports --noconfirm, --repo-url, and --branch.

Co-authored-by: Frank Vitrano <WHC2006@users.noreply.github.com>
2026-07-23 14:44:24 +00:00

33 lines
1023 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 self-update'
local longs='--aur --repo --skipreview --cleanafter --removemake --noremovemake --noremovermake --bottomup --topdown --clonedir --mflags --sudoloop --nosudoloop --noconfirm --self-update --repo-url --branch --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
;;
self-update | --self-update)
COMPREPLY=($(compgen -W '--noconfirm --repo-url --branch' -- "$cur"))
return
;;
esac
if [[ $cur == -* ]]; then
COMPREPLY=($(compgen -W "$ops $longs" -- "$cur"))
else
COMPREPLY=($(compgen -W "self-update $(pacman -Ssq "^${cur}" 2>/dev/null | head -40)" -- "$cur"))
fi
}
complete -F _miaur miaur