summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bash-completion10
1 files changed, 5 insertions, 5 deletions
diff --git a/bash-completion b/bash-completion
index 2a53c1a..9ede30f 100644
--- a/bash-completion
+++ b/bash-completion
@@ -1,7 +1,7 @@
+#!/bin/bash
# mkinitcpio bash completion by Seblu <seblu@seblu.net>
-_lsinitcpio ()
-{
+_lsinitcpio() {
local action cur
action="-a -h -v -x"
_get_comp_words_by_ref cur
@@ -25,8 +25,7 @@ _find_kernel_versions() {
$(compgen -W "${matches[*]}" -- $cur))
}
-_mkinitcpio ()
-{
+_mkinitcpio() {
local action cur prev
action="-c -k -s -b -g -p -S -v -M -L -H -h"
_get_comp_words_by_ref cur prev
@@ -36,9 +35,10 @@ _mkinitcpio ()
-b) COMPREPLY=($(compgen -d "$cur" -- $cur));;
-p) COMPREPLY=($(cd /etc/mkinitcpio.d/ && compgen -X '!*.preset' -f -- $cur|sed 's/\.preset//'));;
-H|-S) COMPREPLY=($(cd /lib/initcpio/install/ && compgen -f -- $cur));;
- *) COMPREPLY=($(compgen -W "${action}" -- "$cur"));;
+ *) COMPREPLY=($(compgen -W "${action}" -- "$cur"));;
esac
}
+
complete -F _mkinitcpio mkinitcpio
complete -F _lsinitcpio lsinitcpio