Add xbps cleanup option
This commit is contained in:
parent
5a27ca1068
commit
2f584c56ec
|
@ -1,5 +1,5 @@
|
|||
function fbps
|
||||
argparse 'h/help' 'i/install' 'r/remove' -- $argv
|
||||
argparse 'h/help' 'i/install' 'r/remove' 'c/clean' -- $argv
|
||||
or return
|
||||
|
||||
set --local -x FZF_DEFAULT_OPTS '--cycle --layout=reverse --border --height=40% --preview-window=wrap --marker="*" --color=bg+:#313244,spinner:#f5e0dc,hl:#f38ba8 --color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc --color=marker:#f5e0dc,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8'
|
||||
|
@ -8,11 +8,15 @@ function fbps
|
|||
xbps-query -l | rg -o --pcre2 '(?<=\\w{2}\\s)[A-z-]*(?=-\\d+.*)' | fzf -q "$1" -m --preview 'xbps-query {1} | bat -p --language yaml --color=always' | xargs -ro sudo xbps-remove
|
||||
else if set -ql _flag_install
|
||||
xbps-query -Rs '*' | rg -o --pcre2 '(?<=\[-\]\s)[\w-]*(?=-\d+.*)' | fzf -q "$1" -m --preview 'xbps-query -R {1} | bat -p --language yaml --color=always' | xargs -ro sudo xbps-install
|
||||
else if set -ql _flag_clean
|
||||
sudo xbps-remove -yOo
|
||||
else
|
||||
echo -e "Usage: fbps [MODE]\n"
|
||||
echo "MODE"
|
||||
echo -e " -h --help\tShow this help"
|
||||
echo -e " -i --install\tInstall a remote package"
|
||||
echo -e " -r --remove\tRemove an installed package"
|
||||
echo -e " -c --clean\tCleanup old/cached packages"
|
||||
return 0
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue