zsh-workers
 help / color / mirror / code / Atom feed
From: Tobias Gruetzmacher <tobias@portfolio16.de>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: _qemu
Date: Sat, 24 Feb 2007 13:46:34 +0100	[thread overview]
Message-ID: <20070224124633.GA6157@portfolio16.de> (raw)
In-Reply-To: <20070224020427.GA3466@scowler.net>

[-- Attachment #1: Type: text/plain, Size: 3577 bytes --]

Hi,

On Fri, Feb 23, 2007 at 09:04:27PM -0500, Clint Adams wrote:
> -soundhw, -net, -serial, -parallel, -monitor, and probably others
> could use some work.

I had an old completion for qemu that I wrote at some time... Here is a
patch adding the useful bits from my file:

Index: Completion/Unix/Command/_qemu
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_qemu,v
retrieving revision 1.1
diff -u -r1.1 _qemu
--- Completion/Unix/Command/_qemu       24 Feb 2007 02:06:26 -0000      1.1
+++ Completion/Unix/Command/_qemu       24 Feb 2007 12:39:46 -0000
@@ -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 @@
 _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 @@
   '-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' \

Greetings, Tobi

-- 
GPG-Key 0xE2BEA341 - signed/encrypted mail preferred
My, oh so small, homepage: http://portfolio16.de/
http://www.fli4l.de/ - ISDN- & DSL-Router on one disk!
Registered FLI4L-User #00000003

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

      reply	other threads:[~2007-02-25  4:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-24  2:04 Clint Adams
2007-02-24 12:46 ` Tobias Gruetzmacher [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070224124633.GA6157@portfolio16.de \
    --to=tobias@portfolio16.de \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).