Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completing multiple states with _arguments
- X-seq: zsh-users 15529
- From: Peter Stephenson <Peter.Stephenson@xxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Completing multiple states with _arguments
- Date: Wed, 10 Nov 2010 10:20:34 +0000
- In-reply-to: <AANLkTintH3mBrt+_csUYuJX8FM76_j6AhPXjoXCU2WXP@xxxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: Cambridge Silicon Radio
- References: <AANLkTintH3mBrt+_csUYuJX8FM76_j6AhPXjoXCU2WXP@xxxxxxxxxxxxxx>
On Tue, 9 Nov 2010 23:49:41 +0100
Nikolai Weibull <now@xxxxxxxx> wrote:
> Hi!
>
> How do I deal with multiple states when completing with _arguments?
>
> local context state line
> typeset -A opt_args
>
> _arguments \
> ':: :->something-optional-before-files' \
> '*:: :->file' && ret=0
>
> # Now what?
Usually you would use "case $state ... esac" to handle the states, with
matches against something-optional-before-files, file, etc. There are
quite a few uses of this if you search for $state in completion.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK
Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
Messages sorted by:
Reverse Date,
Date,
Thread,
Author