about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2007-02-25 19:18:13 +0000
committerClint Adams <clint@users.sourceforge.net>2007-02-25 19:18:13 +0000
commit9d55e0002c850ff5697598e00b5245d246e61f8f (patch)
tree9e87a1148fc7b4978621e8d5c85e7f4910647fba /Completion
parent923e7cfa6252b35b53232b85af9cd27368ca33ea (diff)
downloadzsh-9d55e0002c850ff5697598e00b5245d246e61f8f.tar.gz
zsh-9d55e0002c850ff5697598e00b5245d246e61f8f.tar.xz
zsh-9d55e0002c850ff5697598e00b5245d246e61f8f.zip
23185: qemu completion improvements.
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_qemu31
1 files changed, 20 insertions, 11 deletions
diff --git a/Completion/Unix/Command/_qemu b/Completion/Unix/Command/_qemu
index 6fbaf3bd7..db4b3a445 100644
--- a/Completion/Unix/Command/_qemu
+++ b/Completion/Unix/Command/_qemu
@@ -1,5 +1,14 @@
 #compdef qemu
 
+_qemu_log_items () {
+  local -a opts hline
+  qemu -d \? | while read -A hline; do
+    [[ $hline[1] = Log ]] && continue
+    opts=($opts "${hline[1]}[${hline[2,-1]}]")
+  done
+  _values -s , 'log items' $opts
+}
+
 local _qemu_machines
 
 _qemu_machines=(${${${(f)"$(qemu -M \?)"}[2,-1]}%% *})
@@ -7,11 +16,11 @@ _qemu_machines=(${${${(f)"$(qemu -M \?)"}[2,-1]}%% *})
 _arguments \
   '-'{fda,fdb,hda,hdb,hdc,hdd,cdrom}':disk image:_files' \
   '-M[target machine]:machine:('"${_qemu_machines:-none}"')' \
-  '-boot:boot device:(a c d)' \
+  '-boot[specify which image to boot from]:boot device:((a\:floppy\ image\ a c\:hard\ disk d\:cdrom))' \
   '-snapshot[write to temporary files instead of disk image files]' \
   '-no-fd-bootchk[disable boot sig checking for floppies in Bochs BIOS]' \
-  '-m[virtual RAM size]:megs:' \
-  '-m[simulate SMP system]:number of CPUs:' \
+  '-m[virtual RAM size (default=128)]:megs:' \
+  '-smp[set the number of CPUs (default=1)]:number of CPUs:' \
   '-nographic[disable graphical output]' \
   '-vnc[listen on VNC display]:display:' \
   '-k[use keyboard layout]:keyboard layout language:(ar de-ch es fo fr-ca hu ja mk no pt-br sv da en-gb et fr fr-ch is lt nl pl ru th de en-us fi fr-be hr it lv nl-be pt sl tr)' \
@@ -24,20 +33,20 @@ _arguments \
   '-usb[enable USB driver]' \
   '-usbdevice:usb device:' \
   '-net:net config:(none)' \
-  '-tftp:prefix:' \
-  '-smb:dir:_files -/' \
-  '-redir:port redir config:' \
-  '-kernel:kernel image:_files' \
-  '-append:kernel cmd line:' \
-  '-initrd:initrd:_files' \
+  '-tftp[allow tftp access to files starting with prefix]:tftp prefix:_files' \
+  '-smb[allow SMB access to files in specified directory]:samba directory:_path_files -/' \
+  '-redir[redirect TCP or UDP connections from host to guest]:redirection: ' \
+  '-kernel[boot specified linux kernel]:kernel image:_files' \
+  '-append[use specified kernel command line]:command line: ' \
+  '-initrd[use specified initial ram disk]:ram disk:_files' \
   '-serial:dev:(vc stdio pty null /dev/ttyS0 /dev/partport0)' \
   '-parallel:dev:(vc stdio pty null /dev/ttyS0 /dev/partport0)' \
   '-monitor:dev:(vc stdio pty null /dev/ttyS0 /dev/partport0)' \
   '-s[wait gdb connection to port 1234]' \
   '-p[change gdb connection port]:port:_ports' \
   '-S[do not start CPU at startup]' \
-  '-d[output log in /tmp/qemu.log]' \
-  '-hdachs:hd0 geometry:' \
+  '-d[output log in /tmp/qemu.log]:log items:_qemu_log_items' \
+  '-hdachs[force hard disk 0 geometry (usually qemu can guess it)]:hd0 geometry c,h,s:' \
   '-std-vga[simulate standard VGA]' \
   '-no-acpi[disable ACPI]' \
   '-loadvm[start right away with a saved state]:file:_files' \