chiark / gitweb /
resolved: when answer A or AAAA questions, order responses by whether addresses are...
[elogind.git] / shell-completion / zsh / _kernel-install
1 #compdef kernel-install
2
3 _images(){
4     if [[ "$words[2]" == "remove" ]]; then
5         _message 'No more options'
6     else
7         _path_files -W /boot/ -P /boot/ -g "vmlinuz-*"
8     fi
9 }
10
11 _kernels(){
12     read _MACHINE_ID < /etc/machine-id
13     _kernel=( /lib/modules/[0-9]* )
14     if [[ "$cmd" == "remove" && -n "$_MACHINE_ID" ]]; then
15         _kernel=( "/boot/$_MACHINE_ID"/[0-9]* )
16     fi
17     _kernel=( ${_kernel##*/} )
18     _describe "installed kernels" _kernel
19 }
20
21 _arguments \
22     '1::add or remove:(add remove)' \
23     '2::kernel versions:_kernels' \
24     '3::kernel images:_images'
25
26 #vim: set ft=zsh sw=4 ts=4 et