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>
This commit is contained in:
Cursor Agent
2026-07-23 14:44:24 +00:00
co-authored by Frank Vitrano
parent bba71040d6
commit a4f4767c47
11 changed files with 293 additions and 8 deletions
+7 -3
View File
@@ -5,8 +5,8 @@ _miaur() {
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'
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)
@@ -17,12 +17,16 @@ _miaur() {
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 "$(pacman -Ssq "^${cur}" 2>/dev/null | head -40)" -- "$cur"))
COMPREPLY=($(compgen -W "self-update $(pacman -Ssq "^${cur}" 2>/dev/null | head -40)" -- "$cur"))
fi
}
complete -F _miaur miaur