Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: completion for printf-style format strings
- X-seq: zsh-users 7966
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: completion for printf-style format strings
- Date: Fri, 03 Sep 2004 17:08:02 +0200
- In-reply-to: <dc507f4a0409030750406b0e9a@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <dc507f4a0409030750406b0e9a@xxxxxxxxxxxxxx>
Felix Rosencrantz wrote:
> Does anyone have code to perform completion of printf-style format strings?
>
> I think it was suggested that it might be possible to do with
> _regex_arguments. but not sure if there is an example somewhere or a
> utility function.
It wouldn't be possible with _regex_arguments. _regex_arguments is only
useful when completing a single command-line argument in full. It never
uses compset -P/-S to cut the current word down into chunks.
You would probably want to use patterns a lot though. Basically you need
to remove any literal characters and complete format specifications from
the front of the word. Then you can deal with any partially complete
format specifications. What might be good is to make it sufficiently
general so as to be usable for things like strftime too.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author