mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-11-11 04:20:01 +01:00
unposted: add _rebootin completion from Mandriva RPM
This commit is contained in:
parent
a21ffe815d
commit
8ebd5d34ea
@ -1,3 +1,9 @@
|
||||
2009-01-09 Andrey Borzenkov <bor@zsh.org>
|
||||
|
||||
* unposted: Completion/Mandriva/Command/.distfiles,
|
||||
Completion/Mandriva/Command/_rebootin: add _rebootin completion
|
||||
from Mandriva RPM (modified to allow spaces in GRUB menu titles)
|
||||
|
||||
2009-01-09 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* Benjamin R. Haskell: 26265: Functions/Zle/define-composed-chars:
|
||||
|
@ -1,4 +1,5 @@
|
||||
DISTFILES_SRC='
|
||||
.distfiles
|
||||
_urpmi
|
||||
_rebootin
|
||||
'
|
||||
|
27
Completion/Mandriva/Command/_rebootin
Normal file
27
Completion/Mandriva/Command/_rebootin
Normal file
@ -0,0 +1,27 @@
|
||||
#compdef rebootin
|
||||
|
||||
local loader=$(sudo detectloader -q)
|
||||
|
||||
_arguments -C -s \
|
||||
'-n[No immediate reboot just set the flags for next reboot.]' \
|
||||
'-f[Create a /fastboot file to reboot in fastboot mode]' \
|
||||
'*::arguments:->loader_entry'
|
||||
|
||||
local expl
|
||||
case $state in
|
||||
loader_entry)
|
||||
case $loader in
|
||||
GRUB)
|
||||
if [ -r /boot/grub/menu.lst ];then
|
||||
compadd ${${(M)${(f)"$(</boot/grub/menu.lst)"}##title *}#title }
|
||||
fi
|
||||
;;
|
||||
LILO)
|
||||
if [ -r /etc/lilo.conf ];then
|
||||
compadd $(awk -F= '{ if ($0 ~ /label=/) print $2 }' /etc/lilo.conf)
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
esac
|
Loading…
Reference in New Issue
Block a user