summaryrefslogtreecommitdiffstats
path: root/0029-dracut-bash-completion.sh-file-filename-completion.patch
blob: 321926305f7cc7a3148fad8fe70bd258b2c40a10 (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
28
29
30
31
32
33
34
35
From 46a885bf9f90f7cfacb6977ff602c04efdb75f8e Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 16 Apr 2013 11:18:18 +0200
Subject: [PATCH] dracut-bash-completion.sh: file filename completion

---
 dracut-bash-completion.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dracut-bash-completion.sh b/dracut-bash-completion.sh
index 322e630..ae33b3e 100644
--- a/dracut-bash-completion.sh
+++ b/dracut-bash-completion.sh
@@ -44,15 +44,19 @@ _dracut() {
 
         if __contains_word "$prev" ${OPTS[ARG]}; then
                 case $prev in
-                        --kmoddir|-k|--fwdir|-c|--conf|--confdir|--tmpdir|--sshkey|--add-fstab|--add-device|-I|--install)
+                        --kmoddir|-k|--fwdir|--confdir|--tmpdir)
                                 comps=$(compgen -d -- "$cur")
                                 compopt -o filenames
                         ;;
+                        -c|--conf|--sshkey|--add-fstab|--add-device|-I|--install)
+                                comps=$(compgen -f -- "$cur")
+                                compopt -o filenames
+                        ;;
                         -a|-m|-o|--add|--modules|--omit)
                                 comps=$(dracut --list-modules 2>/dev/null)
                         ;;
                         --kver)
-                                comps=$(cd /lib/modules; echo *)
+                                comps=$(cd /lib/modules; echo [0-9]*)
                         ;;
                         *)
                                 return 0