From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18327 invoked from network); 26 Aug 2003 00:18:52 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 26 Aug 2003 00:18:52 -0000 Received: (qmail 25833 invoked by alias); 26 Aug 2003 00:18:46 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18965 Received: (qmail 25823 invoked from network); 26 Aug 2003 00:18:46 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 26 Aug 2003 00:18:46 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [193.11.248.2] by sunsite.dk (MessageWall 1.0.8) with SMTP; 26 Aug 2003 0:18:45 -0000 Received: by glutus.hemmet.chalmers.se (Postfix, from userid 8) id 4229AD7B32; Tue, 26 Aug 2003 02:18:42 +0200 (CEST) Received: from [192.168.0.2] (chmod007.hemmet.chalmers.se [193.11.248.243]) by glutus.hemmet.chalmers.se (Postfix) with ESMTP id CFAD1D7B31 for ; Tue, 26 Aug 2003 02:18:36 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v588) Content-Transfer-Encoding: 7bit Message-Id: Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: zsh-workers@sunsite.dk From: David Remahl Subject: Complicated Completions Date: Tue, 26 Aug 2003 02:18:25 +0200 X-Mailer: Apple Mail (2.588) X-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_20,USER_AGENT_APPLEMAIL version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) X-Scanned-By: CLAM (openantivirus DB) antivirus scanner at mail.csbnet.se Hi. I'm new to the list - I did try to search the archives, but I'm afraid my question is of a more abstract kind. I have spent some time trying to get to know the completion system. My aim is to create completion functions for some of the useful and surprisingly well-documented command line tools specific to Mac OS X (hdiutil, diskutil, defaults, SystemStarter, ditto to mention a few). The thing is, some of them use rather peculiar and complex command line syntaxes, so creating useful completions is quite a challenge. I would like to request some guidance in creating a completion function for the hdiutil command. As you know, the documentation is thorough, but not very friendly to new developers, so I believe all I need is some help getting started. I will begin by describing the command line syntax of hdiutil, using snippets from the man page. SYNOPSIS hdiutil verb [options] Verb is one of the following: attach, detach, verify, create, convert, burn, help, info, load, checksum, eject (synonym for detach), flatten, unflatten, imageinfo, mount (synonym for attach), mountvol, unmount, plugins, internet-enable, resize, segment, partition, makehybrid, pmap The set of allowed options depends on the sub command (verb). All verbs accept the following optional options (duh), all mutually exclusive: -verbose -quiet -debug Many verbs accept these options: -plist -srcimagekey = -tgtimagekey = -encryption [crypto method] -stdinpass -passphrase password -shadow [shadow file] Many verbs take additional options that are specific to that verb. For example, convert takes the following additional arguments / options: Required: imagefile (source file name) -format fmt (fmt is one of UDRW UFBI UDRO UDCO...DC42) -o dest (destination file name) Optional: -align sector_alignment -segmentSize [sector count] or -segmentSize like mkfile(8) Several commands (attach|verify|compact|convert|burn|checksum|chpass|*flatten|fsid|image- info|internet-enable|resize|segment|partition|pmap) take exactly one filename argument - of a .dmg file. That corresponds to imagefile in teh above convert example. Could someone outline how I would arrange the completion function for this command? The _ifconfig sample gave me some hints, but I'm having trouble extending it past the verb... / Rgds, David Remahl