From: Michael Prokop Date: Mon, 2 Mar 2009 23:02:52 +0000 (+0100) Subject: Add zsh completion for grml2usb X-Git-Tag: v0.9.3~13 X-Git-Url: http://git.grml.org/?p=grml2usb.git;a=commitdiff_plain;h=20409d2dff82c18ff5b420f9771120e48ec086b0 Add zsh completion for grml2usb --- diff --git a/debian/changelog b/debian/changelog index cacaea7..b5464f8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +grml2usb (0.9.3) UNRELEASED; urgency=low + + * Add zsh completion for grml2usb. + + -- Michael Prokop Tue, 03 Mar 2009 00:02:37 +0100 + grml2usb (0.9.2) unstable; urgency=low * Rewrote grml2usb from scratch (in python). New features: diff --git a/grml2usb b/grml2usb index c3d7beb..1089dab 100755 --- a/grml2usb +++ b/grml2usb @@ -18,7 +18,7 @@ from inspect import isroutine, isclass import datetime, logging, os, re, subprocess, sys, tempfile, time # global variables -PROG_VERSION = "0.9.2" +PROG_VERSION = "0.9.3" MOUNTED = set() # register mountpoints TMPFILES = set() # register tmpfiles DATESTAMP = time.mktime(datetime.datetime.now().timetuple()) # unique identifier for syslinux.cfg diff --git a/zsh/_grml2usb b/zsh/_grml2usb new file mode 100644 index 0000000..4d0813b --- /dev/null +++ b/zsh/_grml2usb @@ -0,0 +1,48 @@ +#compdef grml2usb +# Filename: /etc/zsh/completion.d/_grml2usb +# Purpose: completion of command grml2usb for zsh (z shell) +# Authors: grml-team (grml.org), (c) Michael Prokop +# Bug-Reports: see http://grml.org/bugs/ +# License: This file is licensed under the GPL v2. +################################################################################ + +local arguments dev +local -a devices + +devices=() + +for dev in /dev/sd* /dev/hd* ; do + if [[ $(cat /sys/block/${dev#*dev/}/removable 2>/dev/null) == '1' ]] ; then + part=$(ls /dev/${dev#*dev/}[0-9]) + devices+=$part + fi +done + +# TODO: +# * handling of --bootoptions=BOOTOPTIONS and --lilo-binary=LILOBIN +# * $devices should also list directories as valid target +# * as output before :device:.... ISO files and/or /live/image should be suggested + +arguments=( + '--help[display help message and exit]:' + '--bootoptions=[use specified bootoptions as default]:' + '--bootloader-only[do not copy files but just install a bootloader]' + '--copy-only[copy files only but do not install bootloader]' + '--dry-run[avoid executing commands]' + '--fat16[format specified partition with FAT16]' + '--force[force any actions requiring manual interaction]' + '--lilo-binary=LILOBIN[lilo executable to be used for installing MBR]:' + '--mbr-manager[enable interactive boot manager menu in MBR]' + '--quiet[do not output anything but just errors on console]' + '--skip-addons[do not install /boot/addons/ files]' + '--skip-mbr[do not install a master boot record (MBR) on the device]' + '--syslinux[install syslinux bootloader instead of grub]' + '--syslinux-mbr[install syslinux master boot record (MBR) instead of default]' + '--verbose[enable verbose mode]' + '--version[display program version and exit]' + ':device:($devices)' +) +_arguments -s $arguments + +## END OF FILE ################################################################# +# vim:foldmethod=marker