From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19075 invoked by alias); 4 Sep 2016 18:26:59 -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: 39172 Received: (qmail 22977 invoked from network); 4 Sep 2016 18:26:59 -0000 X-Qmail-Scanner-Diagnostics: from out4-smtp.messagingengine.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(66.111.4.28):SA:0(0.0/5.0):. Processed in 0.131886 secs); 04 Sep 2016 18:26:59 -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=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=Prd7qOB7MD0ENelSldOTSte/77g=; b=YebRpJ tZ0M4W31IwnTfYacedt1UIlCICqojGaX4e3TQicfwbfl8NhdN3wYakCe7u4jYT5X Sn9XkNS5oA3C0t18rzcbciFVyCwTF3nrkCgJMmI1yKeQv0ULaOlBLfUi4sJkcAcJ v0NtnoFOeRVOOqD/HiOZokSEKtymGHtYbjfnk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=Prd7qOB7MD0ENelSldOTSte/77g=; b=Yl9g5 Z9wkZieCQW+nmRreSHxr4c2vm+C8yTg+H5nbLdstBUl+aGyCJcLSW6y9Tz8rHpja CIbCv3y00tgKi4kUJprTBRFFh1m7dMVT7z8tq0wtXD9BDgH6byyqFSB2rrY1h3ow iEemLBZeA4XJUPW6XOJ1lYwDS/q40+ul8ZH4DM= X-Sasl-enc: rW6NpSEOiqRRhbX3IRUOsu87yw7PJSLl069Q+H4dU6y1 1473013615 Date: Sun, 4 Sep 2016 18:26:22 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Cc: Marko Myllynen Subject: _libvirt, $opt_args, and noglob Message-ID: <20160904182622.GA32454@fujitsu.shahaf.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.23 (2014-03-12) The question mark in «noglob virsh -c foo://bar?» is interpreted by the _call_program subshell as a pattern, causing _libvirt to fail to find completions: (setup) % zstyle :completion:\*:warnings format 'No matches: %D' % functions -T $_comps[libvirt] % noglob virsh -c qemu:///system? start --domain ⋮ +_libvirt:142> values=+_libvirt:142> _call_program domains 'virsh -c qemu\:///system? list --inactive --name' +_libvirt:142> values=( ) No matches: cmdopt Now create a filename that matches that globbing pattern and try the command again: % noglob mkdir -p ./qemu:/system? % noglob virsh -c qemu:///system? start --domain I believe the reason it works is that the globbing pattern «qemu:///system?» gets expanded into the filename «qemu:/system?», which happens to work just fine as an argument to «virsh -c». (The backslash in front of the colon here is an independent problem, see 39158.) In the special case of _libvirt, simply adding noglob to the _call_program arguments would probably fix this. This might not work for arbitrary other callsites, though. I think the general fix would be to backslash-escape the characters that "need escaping only when noglob is not present". (Neither (q) nor (b) do this since both of them escape backslashes.) Cheers, Daniel