zsh-workers
 help / color / mirror / code / Atom feed
* Compctl long options?
@ 1998-08-19  9:25 Peter Stephenson
  0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 1998-08-19  9:25 UTC (permalink / raw)
  To: Zsh hackers list

It occurred to me that it might be possible and sensible to extend
compctl to use Posictic long options, as GNU utilities do.  Since only
`--' has a meaning at the moment, it should be possible to parse
`--anything-else' without a clash.  It could even be in a separate
library, with loading triggered by finding something after a `--'.
This is looking more and more helpful after Sven's patches for
grouping.  The internal structures wouldn't need to change, only
initialisation files would become larger, but considerably more
readable.  The sort of thing I had in mind was (adapting my compctl
for find which is age old and therefore not necessarily optimal):

compctl --prefix '-' --array "(atime ctime depth ...)" \
  --extended 'c[-1,-fstype]' --array "(nfs pc ufs cdfs)" \
  --or 'C[-1,-(name|cpio|newer)]' --file \
  --or 'c[-1,-type]' --array "(c b d f p l s)" \
  --or 'c[-1,-user]' --user \
  --or 'C[-1,-(exec|OK)]' --command \
  --or 'p[1]' --directory --end find

It's not clear to me if it's possible or desirable to overload names
like --or and --end for different circumstances to minimise the number
of extra options.  It should be possible to allow unambiguous
abbreviations.  Maybe even the extended completion choices can be
made clearer, e.g. 'compare-word[-1,-fstype]' and
'pattern-compare-word[-1,-(name|cpio|newer)]' or something more
compact.

It would also open up the possibility of having more control over
completion from within particular compctl's: it's easy to do in the
code, just hard to find the right options.  For example, there may be
particular cases where you want to use --menu-complete (e.g. in
combination with -U or --always-use).  That would be an improvement
over what I implemented for completion widgets.

Very likely it's not a good idea to implement anything like this until
after the current set of changes have appeared.

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Gruppo Teorico, Dipartimento di Fisica
Piazza Torricelli 2, 56100 Pisa, Italy


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1998-08-19  9:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-08-19  9:25 Compctl long options? Peter Stephenson

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