From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1883 invoked by alias); 23 Jul 2017 07:55:10 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41448 Received: (qmail 3487 invoked from network); 23 Jul 2017 07:55:10 -0000 X-Qmail-Scanner-Diagnostics: from nm16-vm4.bullet.mail.ir2.yahoo.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(212.82.96.210):SA:0(-2.8/5.0):. Processed in 1.308115 secs); 23 Jul 2017 07:55:10 -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=-2.8 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: okiddle@yahoo.co.uk X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.mail.yahoo.com designates 212.82.96.210 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1500796086; bh=yFjKvsLY/Mz0wngC4fTLz4E/Tis2y0rFdiMUncYsCAA=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=sxIu1zAO1rGtKmG27ytLXS6pd7AFhbOLASZ7hB9L6ChuLcXFGhcGpuV9f40r+hlGiT0j/HAEMQ1RX0KVJZbbEofB9op+aHcjZEmVfzrrXOjAqLzKywrmEDMInub0/M9PDwMODyldV1dk+aSJqRLVsWmrC9dUUGAymapYj7MEkqR+lQq2u91XNhPITtrskwg9pursva+T6cuZJ1+ui+e1FyfpKFMkXe1s6kX/EfjmmnG1SMDSMbao1RZhqIC7oDj8FwcVXO6LbZGH/fz6R5+ttkoeoo5i67VXpbmseS/NZO6YfixvfvNLvAXMt5qUo8zMriv4YbHWRfBV8opKFmfq4Q== X-Yahoo-Newman-Id: 304484.77417.bm@smtp103.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: uT_lYeAVM1mOc1BiJ9aatZG5ZQL0iyvemWLWRUWyX7wBV55 63CgYd75dOrjqSIGWqli.NSe_M6W9OJ_Be_h2sKUg6DRbYNNC1xQlwfaRBNS ENcRReEOO6tgoq3rTAFTAwtZHaJtPIK.j_oFFE5faEyayGidjm3xBjuZFF6W WknKzZHNcxudBAOpMxS2Bp8Jip4ZxXOt1pBJJgyOU3kDwKU6aPdXSMWh57nj tpnwKjVlAVVII5Tc6PF.3mm.koJ4CsrQbd1bV1GbdyPoEt6BZF0Y0vFamzRv RH9j9dIREvcLXsrO59OHZQepdGFZiM5yjU4Bp.bvElmD2Inl3eK6Rb6qSBu5 agACFpgMkiHleR84aJGkQX085kfTuaCaA3d6zdQj0mOmwgT_wHEb07qvO_u3 MP6RL0aT0uISW4jzC81qEcSd1c1E7_qt1i1Jk_3EtXyq9EGJGPQR43JKxUqI 0In10Nl6rW8OzF0gtU.4hRWpMx5bso7Okj5jAEI.xJkzmVNEvKGWD0Yo2Lbo 9bhCIZCeN415mahgfdGpdWVZFBEMeY55N180z8ZdT X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: <1500659163.916799.1048510048.293AC92C@webmail.messagingengine.com> From: Oliver Kiddle References: <20170720210607.16753-1-danielsh@tarpaulin.shahaf.local2> <1500659163.916799.1048510048.293AC92C@webmail.messagingengine.com> To: zsh-workers@zsh.org Subject: Re: [PATCH v2] Correct completion of 'tmux new '. MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19453.1500796085.1@thecus.kiddle.eu> Date: Sun, 23 Jul 2017 09:48:05 +0200 Message-ID: <19454.1500796085@thecus.kiddle.eu> Daniel Shahaf wrote: > > I believe I understand what this is doing, but "if there is a single > > argument" isn't entirely clear. It does NOT mean "if there is a > > single positional parameter in the call to this function" (which is > > how I first read it, before I actually looked at the function > > definition); rather it means "if there is more than one word in > > argument position on the command line". > > > > I'll change to your wording before committing. Thanks for the > blind review! For the documentation wouldn't it perhaps be better to describe the basic use first. i.e. it is for commands that are ambivalent about taking either a quoted command-string or a command and series of arguments. Your implementation will favour the _cmdstring variant in the sense that completing a command-name will give you a quoted space as the suffix. I think it would be preferable to check if the first and only argument contains any spaces before switching to the _cmdstring variant and so avoid unnecessary quoting. We might also want to consider the many cases where we use the following _arguments idiom: '(-):command:_command_names -e' \ '*::args:_normal' This also appears in if .. then .. else form in _strace and _socket. It might be good to cover this with a single helper - _cmdrest perhaps - but note that _precommand is not for this purpose: it completes functions and aliases. I'm not convinced that _precommand should be documented in this section at all. It wasn't really meant as a helper but as a as a catch-all handler for the zsh precommand modifiers. Note that it is in Zsh/Command. I see a precommands array was added around 2009 in _precommand to facilitate _calendar's check to see if it was run with command. What do we want to include in this. It might be useful to collect all the wrapper commands and not just zsh precommand modifiers. It is somewhat similar to the _comp_priv_prefix that we added more recently. Oliver