diff mbox

[pacman-dev] use pacman-conf in bash completion

Message ID 20180115211523.21463-1-joel@teichroeb.net
State Accepted, archived
Headers show

Commit Message

Joel Teichroeb Jan. 15, 2018, 9:15 p.m. UTC
Signed-off-by: Joel Teichroeb <joel@teichroeb.net>
---
 scripts/completion/bash_completion.in | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Allan McRae Jan. 19, 2018, 2:04 a.m. UTC | #1
On 16/01/18 07:15, Joel Teichroeb wrote:
> Signed-off-by: Joel Teichroeb <joel@teichroeb.net>
> ---
>  scripts/completion/bash_completion.in | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 


Thanks!
A
diff mbox

Patch

diff --git a/scripts/completion/bash_completion.in b/scripts/completion/bash_completion.in
index 06963c42..9ef43238 100644
--- a/scripts/completion/bash_completion.in
+++ b/scripts/completion/bash_completion.in
@@ -96,6 +96,10 @@  _pacman_pkg() {
   )"
 }
 
+_pacman_repo_list() {
+  _arch_compgen "$(pacman-conf --repo-list)"
+}
+
 _pacman() {
   local common core cur database files prev query remove sync upgrade o
   COMPREPLY=()
@@ -136,7 +140,7 @@  _pacman() {
           _pacman_pkg Qq;;
       S)
         { _arch_incomp 'g groups' && _pacman_pkg Sg; }      ||
-        { _arch_incomp 'l list'   && _pacman_pkg Sl sort; } ||
+        { _arch_incomp 'l list'   && _pacman_repo_list; } ||
           _pacman_pkg Slq;;
       U)
           _pacman_file;;