aboutsummaryrefslogtreecommitdiff
path: root/aur.completor.bash
diff options
context:
space:
mode:
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") )
+}