summaryrefslogtreecommitdiff
path: root/d9324c0c43e876d6f53b2d711dba375c119d22c5.patch
blob: b2d2ebf77a8a9f93534d71d611c598ae25b1f957 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From d9324c0c43e876d6f53b2d711dba375c119d22c5 Mon Sep 17 00:00:00 2001
From: Jaroslav Rohel <jrohel@redhat.com>
Date: Tue, 9 Apr 2024 13:22:57 +0200
Subject: [PATCH] dnf5: Bash completion: Switch to `_init_completion`

- `_init_completion` handles redirections (example 2>/dev/null)
  so completion doesn't have to deal with them.
- `__reassemble_comp_words_by_ref` is private
---
 dnf5/bash-completion/dnf5 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dnf5/bash-completion/dnf5 b/dnf5/bash-completion/dnf5
index a860d3feb..95419e5ab 100644
--- a/dnf5/bash-completion/dnf5
+++ b/dnf5/bash-completion/dnf5
@@ -2,8 +2,8 @@
 
 _do_dnf5_completion()
 {
-    local words=() cword
-    __reassemble_comp_words_by_ref "><=;|&(:" words cword
+    local cur prev words cword comp_args
+    _init_completion -n "><=;|&(:" -- "$@" || return
     mapfile -t COMPREPLY <<<$("${1}" "--complete=${cword}" "${words[@]}")
 }