zsh-workers
 help / color / mirror / code / Atom feed
* Complicated Completions
@ 2003-08-26  0:18 David Remahl
  2003-08-26  9:11 ` Oliver Kiddle
  0 siblings, 1 reply; 4+ messages in thread
From: David Remahl @ 2003-08-26  0:18 UTC (permalink / raw)
  To: zsh-workers

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 <key>=<value>
	-tgtimagekey <key>=<value>
	-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 <??b|??k|??m|??g|??t??p|??e> 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-08-29  9:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-26  0:18 Complicated Completions David Remahl
2003-08-26  9:11 ` Oliver Kiddle
2003-08-28 19:50   ` David Remahl
2003-08-29  9:27     ` Oliver Kiddle

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).