| 1 |
#compdef grml2usb |
| 2 |
# Filename: /etc/zsh/completion.d/_grml2usb |
| 3 |
# Purpose: completion of command grml2usb for zsh (z shell) |
| 4 |
# Authors: grml-team (grml.org), (c) Michael Prokop <[email protected]> |
| 5 |
# Bug-Reports: see http://grml.org/bugs/ |
| 6 |
# License: This file is licensed under the GPL v2. |
| 7 |
################################################################################ |
| 8 |
|
| 9 |
local arguments dev |
| 10 |
local -a devices |
| 11 |
|
| 12 |
devices=() |
| 13 |
|
| 14 |
for dev in /dev/sd* /dev/hd* ; do |
| 15 |
if [[ $(cat /sys/block/${dev#*dev/}/removable 2>/dev/null) == '1' ]] ; then |
| 16 |
part=$(ls /dev/${dev#*dev/}[0-9]) |
| 17 |
devices+=$part |
| 18 |
fi |
| 19 |
done |
| 20 |
|
| 21 |
# TODO: |
| 22 |
# * handling of --bootoptions=BOOTOPTIONS |
| 23 |
# * $devices should also list directories as valid target |
| 24 |
# * as output before :device:.... ISO files and/or /run/live/medium should be suggested |
| 25 |
|
| 26 |
arguments=( |
| 27 |
'--help[display help message and exit]:' |
| 28 |
'--bootoptions=[use specified bootoptions as default]:' |
| 29 |
'--bootloader-only[do not copy files but just install a bootloader]' |
| 30 |
'--copy-only[copy files only but do not install bootloader]' |
| 31 |
'--dry-run[avoid executing commands]' |
| 32 |
'--format[format specified partition with FAT]' |
| 33 |
'--force[force any actions requiring manual interaction]' |
| 34 |
'--mbr-manager[enable interactive boot manager menu in MBR]' |
| 35 |
'--quiet[do not output anything but just errors on console]' |
| 36 |
'--skip-addons[do not install /boot/addons/ files]' |
| 37 |
'--skip-mbr[do not install a master boot record (MBR) on the device]' |
| 38 |
'--syslinux[install syslinux bootloader instead of grub]' |
| 39 |
'--syslinux-mbr[install syslinux master boot record (MBR) instead of default]' |
| 40 |
'--verbose[enable verbose mode]' |
| 41 |
'--version[display program version and exit]' |
| 42 |
':device:($devices)' |
| 43 |
) |
| 44 |
_arguments -s $arguments |
| 45 |
|
| 46 |
## END OF FILE ################################################################# |
| 47 |
# vim:foldmethod=marker |