zsh-completions: kernel-install - only show existing kernels for 'remove'

When we remove a kernel, we don't remove the modules, so don't look at the modules directory to find installed kernels.
This commit is contained in:
Tom Gundersen 2014-02-06 18:15:47 +01:00
parent a50df72b37
commit d72143bad4
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ _kernels(){
read _MACHINE_ID < /etc/machine-id
_kernel=( /lib/modules/[0-9]* )
if [[ "$cmd" == "remove" && -n "$_MACHINE_ID" ]]; then
_kernel=( /lib/modules/[0-9]* "/boot/$_MACHINE_ID"/[0-9]* )
_kernel=( "/boot/$_MACHINE_ID"/[0-9]* )
fi
_kernel=( ${_kernel##*/} )
_describe "installed kernels" _kernel