commit:     aa9418b5e9ffefd14d3abc483c99db586c599ce4
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Thu Jul  4 19:32:44 2024 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Thu Jul  4 19:32:44 2024 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=aa9418b5

bash-completion: use _filedir

This handles spaces and such much much better

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 data/share/bash-completion/completions/pquery | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/data/share/bash-completion/completions/pquery 
b/data/share/bash-completion/completions/pquery
index eedb9a1bb..7711f6b47 100644
--- a/data/share/bash-completion/completions/pquery
+++ b/data/share/bash-completion/completions/pquery
@@ -105,7 +105,7 @@ _pquery() {
             COMPREPLY=($(compgen -W "${boolean_options[*]}" -- "${cur}"))
             ;;
         --config)
-            COMPREPLY=($(compgen -f -- "${cur}"))
+            _filedir
             ;;
         --domain)
             COMPREPLY=()
@@ -128,8 +128,9 @@ _pquery() {
             fi
             ;;
         -r | --repo)
-            COMPREPLY=($(compgen -W "$(_parsereposconf -l)" -- "${cur}"))
-            COMPREPLY+=($(compgen -d -- "${cur}"))
+            _filedir -d
+            COMPREPLY+=($(compgen -W "$(_parsereposconf -l)" -- "${cur}"))
+            # COMPREPLY+=($(compgen -d -- "${cur}"))
             ;;
         --highlight-dep | --print-revdep)
             COMPREPLY=()

Reply via email to