From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14037 invoked by alias); 12 Feb 2016 19:13:57 -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: 21279 Received: (qmail 5117 invoked from network); 12 Feb 2016 19:13:55 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=JOvKPm77LMjsYK0kS5dbiyEuC9DgLab4OqW5jQZcmQM=; b=ujN56oyrBjF3FsZ0p0eqVYyZZb1abkq48iA4tw0ahSy+bNIIQyCbzCNNBsmYk9zn5J BpfmsZBjfmswkLxzvlDVudWcqjW0VQ/Yhv7djUNE8d3OLQkh9p1O/PyrZyaq+K0UVFR9 sDr6Z+gOW7hWdv/OSCvASYiaR86zUWVKhlVWwWAYci4cSb3l9ZpxuCKldEIfYn9HEh8S Hf1sM9bM+3YRAvLeGC++3+0LScaaLxVvw2jnVPssWz9slPnEYZOcVpxCUy4mFqreYYz0 4IhZjQtshUg+YvXEHUt82S7/pusGCMY1RE5rqK4BIgQztTw+x2aN+Ycd5prIsI7aE0LX faEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=JOvKPm77LMjsYK0kS5dbiyEuC9DgLab4OqW5jQZcmQM=; b=Nw7dIdAlE/8POl7DfMJtez//bAPn3sJ0iN32cmlQqc3F5rWqvl8Xgfuu3huvFQe6uP GOekA01KTSr360lYKMTnj6a8x2rw+WIgektT2uwO02lfa+bjkXd5/emdAV9fhV76YEiP HGNYhRfTrHD0/O9Ek9v9CoWDVtTp9x8YZKN5QSON3AugDcyI0I2Z11M1w27cPbDArYwq KQpidMrYs4mzvxOQZUBUG5bLY8sh1jnmzK/yBnr3q8mTjUhuxhKVmrMMJYYrUPrt/UZZ KTBJcll99vkgy0i8vr1dnGKpkG79yGaoh3wAPpofi/i6tP8QnYrJL6rvTyic67D1LTnB 0XNg== X-Gm-Message-State: AG10YOSWSRgCJAI9mbA7fFQplP7EkefXy1zYIadooAS6SsaGIyrdTA0v3tYHMlaSss21yA== X-Received: by 10.66.63.104 with SMTP id f8mr4429929pas.109.1455304433862; Fri, 12 Feb 2016 11:13:53 -0800 (PST) From: Bart Schaefer Message-Id: <160212111407.ZM14812@torch.brasslantern.com> Date: Fri, 12 Feb 2016 11:14:07 -0800 In-Reply-To: Comments: In reply to Sebastian Gniazdowski "Re: Complete with *part* not part*" (Feb 12, 6:29pm) References: <160212080127.ZM14265@torch.brasslantern.com> <160212091607.ZM14469@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh Users Subject: Re: Complete with *part* not part* MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Feb 12, 6:29pm, Sebastian Gniazdowski wrote: } } Fine thing the dtrace, huh. I think it reveals some bugs in my } completion design. Should I be using -C for _arguments? Because there } are tests that look bad, double "argument-rest": } } Zstyle -s :completion::complete:zplugin:argument-rest:argument-rest } matcher match No, nothing is wrong there. Remember that the lookup context is of the format :completion:FUNCTION:COMPLETER:COMMAND:ARGUMENT:TAG So you have COMMAND=zplugin, ARGUMENT=argument-rest, TAG=argument-rest, which is entirely normal: * The ARGUMENT; this indicates which command line or option argument we are completing. For command arguments this generally takes the form argument-N, where N is the number of the argument, and for arguments to options the form option-OPT-N where N is the number of the argument to option OPT. However, this is only the case if the command line is parsed with standard UNIX-style options and arguments, so many completions do not set this. The doc omits the detail that N can be "rest" when all remaining argument positions are treated the same. * The TAG. As described previously, tags are used to discriminate between the types of matches a completion function can generate in a certain context. So you only want -C if there are multiple tags in the argument-rest context, *and* those tags are differentiated by using the ->state form of _arguments specification. The doc goes on: The context is gradually put together as the functions are executed, starting with the main entry point, which adds :completion: and the FUNCTION element if necessary. The completer then adds the COMPLETER element. The contextual completion adds the COMMAND and ARGUMENT options. Finally, the TAG is added when the types of completion are known. The tag name is actually generated by the "comparguments" builtin in this case, which was intentionally left under-specified in the user-level doc, but then developer-level doc for it was never written ...