aboutsummaryrefslogtreecommitdiff
path: root/aur.completor.bash
diff options
context:
space:
mode:
authorpml68 <contact@pml68.dev>2024-12-21 11:19:11 +0100
committerpml68 <contact@pml68.dev>2024-12-21 11:19:11 +0100
commit55fc35e62ef330b3c8722a50361b9c62dbba181f (patch)
treef89b70c6874db6779248230ff9ea5d22f06c9813 /aur.completor.bash
downloadaur-55fc35e62ef330b3c8722a50361b9c62dbba181f.tar.gz
feat: initial commit
Diffstat (limited to 'aur.completor.bash')
-rw-r--r--aur.completor.bash21
1 files changed, 21 insertions, 0 deletions
diff --git a/aur.completor.bash b/aur.completor.bash
new file mode 100644
index 0000000..28117f4
--- /dev/null
+++ b/aur.completor.bash
@@ -0,0 +1,21 @@
+output=aur-completion.bash
+cmd=aur
+cmd_args=@aur_pkgs
+cmd_opts=(
+ -h --help
+ -l --list
+ -f --force
+ -g --git
+ -c:@files
+ --config:@files
+)
+
+reply_aur_pkgs() {
+ pkgs=( $(find ~/.aur/ -type d -mindepth 1 -maxdepth 1) );
+ for i in "${!pkgs[@]}";
+ do
+ pkgs[$i]=$(basename "${pkgs[$i]}");
+ done;
+
+ COMPREPLY=( $(compgen -W "${pkgs[*]}" -- "$cur") )
+}