From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4122 invoked by alias); 9 Nov 2010 23:56:35 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15528 Received: (qmail 3078 invoked from network); 9 Nov 2010 23:56:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: pass (proxy.melb.primenet.com.au: SPF record at _spf.google.com designates 209.85.214.171 as permitted sender) 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= MIME-Version: 1.0 Sender: nikolai.weibull@gmail.com Date: Tue, 9 Nov 2010 23:49:41 +0100 X-Google-Sender-Auth: eE_3L3b52uFeY9mtNif7Ox6H2a8 Message-ID: Subject: Completing multiple states with _arguments From: Nikolai Weibull To: Zsh Users Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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=3D0 # Now what? The documentation doesn=E2=80=99t give an example, neither does the book, a= nd I was unable to find an example under Completion in the source tree. I=E2=80=99m 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!