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:
co-authored by
Frank Vitrano
parent
bba71040d6
commit
a4f4767c47
@@ -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
|
||||
|
||||
@@ -14,11 +14,13 @@ _miaur() {
|
||||
'-Bi:build and install'
|
||||
'-Sc:clean caches'
|
||||
'-Rns:remove a package'
|
||||
'self-update:update miaur from Git'
|
||||
'--aur:use the AUR only'
|
||||
'--repo:use repositories only'
|
||||
'--skipreview:skip PKGBUILD review'
|
||||
'--noremovemake:keep make dependencies'
|
||||
'--noconfirm:bypass confirmation prompts'
|
||||
'--self-update:update miaur from Git'
|
||||
'--bottomup:show AUR results first'
|
||||
'--help:show help'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user