summaryrefslogtreecommitdiffstats
path: root/bash-completion
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-04-18 01:39:45 +0200
committerDave Reisner <dreisner@archlinux.org>2012-04-22 05:43:52 +0200
commit86dc2a6d71b9330991ab48b9ba00936cd8370182 (patch)
tree18e9774eea22100a6e6d9942a47f6628c094a32b /bash-completion
parentfa5484c81c40e0a5a05194909600716f39ce0faf (diff)
downloadmkinitcpio-86dc2a6d71b9330991ab48b9ba00936cd8370182.tar.gz
mkinitcpio-86dc2a6d71b9330991ab48b9ba00936cd8370182.tar.xz
lsinitcpio: adopt parseopts for option parsing
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'bash-completion')
-rw-r--r--bash-completion16
1 files changed, 10 insertions, 6 deletions
diff --git a/bash-completion b/bash-completion
index f4c476b..b7ab5bc 100644
--- a/bash-completion
+++ b/bash-completion
@@ -2,18 +2,22 @@
# mkinitcpio bash completion by Seblu <seblu@seblu.net>
_lsinitcpio() {
- local action cur
- action="-a -h -n -v -x"
+ local cur opts
+ opts=(-a --analyze -h --help -n --nocolor -v --verbose -x --extract)
+
_get_comp_words_by_ref cur
- case "$cur" in
- -*) COMPREPLY=($(compgen -W "${action}" -- "$cur"));;
- *) _filedir;;
+
+ case $cur in
+ -*)
+ COMPREPLY=($(compgen -W "${opts[*]}" -- "$cur")) ;;
+ *)
+ _filedir ;;
esac
}
_find_kernel_versions() {
local -a matches
- local regex
+ local dir regex
# add completions from kernels in /boot
regex="Linux kernel.*version"