zsh-workers
 help / color / mirror / code / Atom feed
3f30b259145dd7153d489fcbf546621ea3bbe0c7 blob 712 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 
#compdef rebootin

local context state line expl
typeset -A opt_args
local loader=$(sudo detectloader -q)

_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'

case $state in
  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
debug log:

solving 3f30b25 ...
found 3f30b25 in https://git.vuxu.org/mirror/zsh/

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).