Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Completing multiple states with _arguments
- X-seq: zsh-users 15528
- From: Nikolai Weibull <now@xxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Completing multiple states with _arguments
- Date: Tue, 9 Nov 2010 23:49:41 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=K2Q/9lSXL7b20twpOc3ycfF3M/T0yfkpEK65ZcK6puA=; b=PgJigEzpOdvYE3bYE1b2a+ULnwmv7fYuepmqw88kOEn8Q3KdbJabG4KFT+H//VZMBJ hKfbVb7nkMsPGXrQuHI/JFWUyKPAkBT/vps56o0ymFYEoiuShripZUL/SepnBg3vn80d F+4XqVenwNnNcX6iC3av2sUaWbfM87h05DUIA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; b=tWF7fROSqIHdxaG6Rnfpu2SKYllOHk1yra1TcO+mGd55JDyP0DdqEnBuDwvMJELiN7 fInpLtR9C2I4ltkSebB6sZ9cUXjJ1sZckyo//el+Ze7zsEvUDO3eVurWpgc1XnaS2ES9 NOsC1y3bWvNzyIvNL5X3e9lerdyJZ8FfdvY38=
- 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
- Sender: nikolai.weibull@xxxxxxxxx
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?
The documentation doesnât give an example, neither does the book, and
I was unable to find an example under Completion in the source tree.
Iâm updating the git-diff completion (along with all the other git-*
completions), if you want a more specific example. Git diff can take
two arguments that may be commits, trees, or blobs before it takes any
file arguments.
Thanks!
Messages sorted by:
Reverse Date,
Date,
Thread,
Author