26763: fix problem on failed cd -s to relative path
[zsh.git] / Completion / Mandriva / Command / _rebootin
blob5a27bf800c653aad5bec6b17d3f7bd24f9faec55
1 #compdef rebootin
3 local loader=$(sudo detectloader -q)
5 _arguments -C -s \
6     '-n[No immediate reboot just  set the flags for next reboot.]' \
7     '-f[Create a /fastboot file to reboot in fastboot mode]' \
8     '*::arguments:->loader_entry'
10 local expl
11 case $state in
12     loader_entry)
13         case $loader in
14             GRUB)
15                 if [ -r /boot/grub/menu.lst ];then
16                 compadd ${${(M)${(f)"$(</boot/grub/menu.lst)"}##title *}#title }
17                 fi
18                 ;;
19             LILO)
20                 if [ -r /etc/lilo.conf ];then
21                 compadd $(awk -F= '{ if ($0 ~ /label=/) print $2 }' /etc/lilo.conf)
22                 fi
23                 ;;
24             *)
25                 ;;
26         esac
27 esac