From 2f584c56ece6477babd266d923cd5ba422ee390d Mon Sep 17 00:00:00 2001 From: Erin Abicht Date: Sat, 1 Apr 2023 18:36:19 -0400 Subject: [PATCH] Add xbps cleanup option --- functions/fbps.fish | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/functions/fbps.fish b/functions/fbps.fish index 688c6dd..372d9d8 100644 --- a/functions/fbps.fish +++ b/functions/fbps.fish @@ -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