From 07cf5a74aed190308f94eb76d9b1ad08492736a2 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 28 Feb 2013 12:38:24 -0500 Subject: bash-completion: use kernel versions from detection Instead of rummaging through /lib for kernel versions, just use the validated versions from the hunt through /boot. Signed-off-by: Dave Reisner --- bash-completion | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/bash-completion b/bash-completion index e7c1db0..a0f07dc 100644 --- a/bash-completion +++ b/bash-completion @@ -25,21 +25,15 @@ _lsinitcpio() { _find_kernel_versions() { local -a matches - local dir f + local dir f kver for f in /boot/*; do # only match regular files which pass validation if [[ ! -L $f && -f $f ]] && kver=$(_detect_kver "$f"); then - matches+=("$f") + matches+=("$f" "$kver") fi done - # add completions based on kernel versions in /lib/modules - for dir in /lib/modules/*/kernel; do - dir=${dir%/kernel} - matches+=("${dir#/lib/modules/}") - done - COMPREPLY=($(compgen -W "${matches[*]}" -- $cur)) } -- cgit v1.2.3-24-g4f1b