aboutsummaryrefslogtreecommitdiff
path: root/shell-completions
diff options
context:
space:
mode:
authorpml68 <contact@pml68.dev>2025-09-07 12:03:10 +0200
committerpml68 <contact@pml68.dev>2025-09-07 12:03:10 +0200
commitc70c80c789df88aa4ed079c7f8b6fcd4a23cb095 (patch)
treec3bc5cba5b744c0af99d331e7f3d5185cd501b39 /shell-completions
parentfeat: add Makefile (diff)
downloadaur-c70c80c789df88aa4ed079c7f8b6fcd4a23cb095.tar.gz
feat: add -r/--remove flags
Diffstat (limited to 'shell-completions')
-rw-r--r--shell-completions/aur-completion.bash10
-rw-r--r--shell-completions/aur.completor.bash8
-rw-r--r--shell-completions/aur.fish3
3 files changed, 19 insertions, 2 deletions
diff --git a/shell-completions/aur-completion.bash b/shell-completions/aur-completion.bash
index 224f1ee..c365c2e 100644
--- a/shell-completions/aur-completion.bash
+++ b/shell-completions/aur-completion.bash
@@ -12,7 +12,7 @@
# shellcheck disable=2207
# editorconfig-checker-disable
-_aur_comp_cmd_opts=( -h --help -v --version -l --list -f --force -g --git -c --config )
+_aur_comp_cmd_opts=( -h --help -v --version -l --list -f --force -g --git -c --config -r --remove )
_aur_comp_reply_aur_pkgs ()
@@ -59,6 +59,12 @@ _aur_comp_reply_list ()
eval "COMPREPLY=( \$(compgen -W \"$array_list\" -- \"\$cur\") )"
}
+_aur_comp_reply_pacman ()
+{
+ pkgs=$(pacman -Qqm | paste -d ' ' -s -);
+ COMPREPLY=($(compgen -W "$pkgs" -- "$cur"))
+}
+
_aur_comp_reply_words ()
{
local IFS=$'\n';
@@ -95,6 +101,8 @@ _aur_completions() {
# rely the value of command option
-c) _aur_comp_reply_files ;;
--config) _aur_comp_reply_files ;;
+ -r) _aur_comp_reply_pacman ;;
+ --remove) _aur_comp_reply_pacman ;;
*) _aur_comp_reply_aur_pkgs ;;
esac
else
diff --git a/shell-completions/aur.completor.bash b/shell-completions/aur.completor.bash
index cb83422..0479f73 100644
--- a/shell-completions/aur.completor.bash
+++ b/shell-completions/aur.completor.bash
@@ -10,6 +10,8 @@ cmd_opts=(
-g --git
-c:@files
--config:@files
+ -r:@pacman
+ --remove:@pacman
)
reply_aur_pkgs() {
@@ -17,3 +19,9 @@ reply_aur_pkgs() {
COMPREPLY=( $(compgen -W "$pkgs" -- "$cur") )
}
+
+reply_pacman() {
+ pkgs=$(pacman -Qqm | paste -d ' ' -s -)
+
+ COMPREPLY=( $(compgen -W "$pkgs" -- "$cur") )
+}
diff --git a/shell-completions/aur.fish b/shell-completions/aur.fish
index ae54b02..b66ebad 100644
--- a/shell-completions/aur.fish
+++ b/shell-completions/aur.fish
@@ -1,5 +1,5 @@
function _aur_no_switches
- not __fish_contains_opt -s h help -s v version -s l list -s f force -s g git -s c config
+ not __fish_contains_opt -s h help -s v version -s l list -s f force -s g git -s c config -s r remove
end
complete -c aur -f
@@ -9,4 +9,5 @@ complete -c aur -s v -l version
complete -c aur -s l -l list
complete -c aur -s f -l force
complete -c aur -s g -l git
+complete -c aur -s r -l remove -a "(pacman -Qqm)"
complete -c aur -s c -l config -F -r