about summary refs log tree commit diff
path: root/Completion/Mandriva
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2014-10-21 16:11:09 +0200
committerOliver Kiddle <opk@zsh.org>2014-10-21 16:11:09 +0200
commitaf9f623273eb994d36d3f02ed37bac6edb10c7cb (patch)
treece9fb447962017a39bd067e3bb79921de15e0764 /Completion/Mandriva
parente02ff159b3e0254b783e67a9f8225893284aa213 (diff)
downloadzsh-af9f623273eb994d36d3f02ed37bac6edb10c7cb.tar.gz
zsh-af9f623273eb994d36d3f02ed37bac6edb10c7cb.tar.xz
zsh-af9f623273eb994d36d3f02ed37bac6edb10c7cb.zip
33481: resolve completion clashes and tidy-up SUSE/Mandriva related functions
Diffstat (limited to 'Completion/Mandriva')
-rw-r--r--Completion/Mandriva/Command/_rebootin36
1 files changed, 19 insertions, 17 deletions
diff --git a/Completion/Mandriva/Command/_rebootin b/Completion/Mandriva/Command/_rebootin
index 1b69609f3..3f30b2591 100644
--- a/Completion/Mandriva/Command/_rebootin
+++ b/Completion/Mandriva/Command/_rebootin
@@ -1,27 +1,29 @@
 #compdef rebootin
 
+local context state line expl
+typeset -A opt_args
 local loader=$(sudo detectloader -q)
 
-_arguments -C -s \
+_arguments -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
+  loader_entry)
+    case $loader in
+      GRUB)
+	if [ -r /boot/grub/menu.lst ]; then
+	  _wanted -C $context entries expl entry \
+	      compadd ${${(M)${(f)"$(</boot/grub/menu.lst)"}##title *}#title }
+	fi
+      ;;
+      LILO)
+	if [ -r /etc/lilo.conf ]; then
+	  _wanted -C $context entries expl entry \
+	      compadd $(awk -F= '{ if ($0 ~ /label=/) print $2 }' /etc/lilo.conf)
+	fi
+      ;;
+    esac
+  ;;
 esac