about summary refs log tree commit diff
path: root/Completion/Mandriva
diff options
context:
space:
mode:
authorAndrey Borzenkov <bor@users.sourceforge.net>2009-01-09 11:34:03 +0000
committerAndrey Borzenkov <bor@users.sourceforge.net>2009-01-09 11:34:03 +0000
commit8ebd5d34ea7037dff00988a55aa3f4c1430884a4 (patch)
tree367b04a9777518f9fa71addd62e1ef0bb2646d58 /Completion/Mandriva
parenta21ffe815d29180787f55b10a9eaed6d995f669c (diff)
downloadzsh-8ebd5d34ea7037dff00988a55aa3f4c1430884a4.tar.gz
zsh-8ebd5d34ea7037dff00988a55aa3f4c1430884a4.tar.xz
zsh-8ebd5d34ea7037dff00988a55aa3f4c1430884a4.zip
unposted: add _rebootin completion from Mandriva RPM
Diffstat (limited to 'Completion/Mandriva')
-rw-r--r--Completion/Mandriva/Command/.distfiles1
-rw-r--r--Completion/Mandriva/Command/_rebootin27
2 files changed, 28 insertions, 0 deletions
diff --git a/Completion/Mandriva/Command/.distfiles b/Completion/Mandriva/Command/.distfiles
index 91e79f8e9..72f101fd7 100644
--- a/Completion/Mandriva/Command/.distfiles
+++ b/Completion/Mandriva/Command/.distfiles
@@ -1,4 +1,5 @@
 DISTFILES_SRC='
 .distfiles
 _urpmi
+_rebootin
 '
diff --git a/Completion/Mandriva/Command/_rebootin b/Completion/Mandriva/Command/_rebootin
new file mode 100644
index 000000000..5a27bf800
--- /dev/null
+++ b/Completion/Mandriva/Command/_rebootin
@@ -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