From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27126 invoked by alias); 20 Dec 2017 04:52:44 -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: List-Unsubscribe: X-Seq: 42145 Received: (qmail 3520 invoked by uid 1010); 20 Dec 2017 04:52:44 -0000 X-Qmail-Scanner-Diagnostics: from mail-io0-f172.google.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(209.85.223.172):SA:0(-1.9/5.0):. Processed in 9.343951 secs); 20 Dec 2017 04:52:44 -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,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8gHpjGMda8ZJ6ZopOWWxGqmHMz8ik/UThSZrbYKLfQo=; b=OlNZBW/WihGG3MHwyrwqYU2Cm7/Y3YbehrTWVGhcDzazbTj/idwuPRyy8ju0pTtPBu 3jQ2kO2kMFPYjyN+FeBiZHEoA9UZBTxJTdQsWzDWxOSqCwSfGniYmKhC7yqAmYmG28V1 5M4M8b6rykT2gax8CUiQLAVSnrOAEWMT8AZrcI5FIgcsaCIKXJcy6S3Mc0OxO03IUb2I f4hGt3snwQlwpjyUfLrLQqeP3QhirBkjZhunXzG/lX1sVxlJEhrOCOhRJYxR9oAmabZ4 CNg2h/g3G4NFrzoCNp0T3htxslYW5DSfnfeavj1e0SJS/P3iWwVq/4/bCaCpEUYeQp4F KV6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8gHpjGMda8ZJ6ZopOWWxGqmHMz8ik/UThSZrbYKLfQo=; b=M3OOt8I2/a0QS4xC9YXhSqTKYfdWUnNzDQEencM3SVPA2gsXMDcmDSUkqMuz/iY+2H TUODFCDDXNBd7SBSyx4yVZ4V19qYJMDk1mjV+yAFSuWli5XlRdxha0kVeEmo9enTruUi lV0EE8CZF2ZOyxrqOhSgT+ajAwdldVlBxGT5C1f+pZtrsNLKzKvjXLLxvHeNJNS+sWcP LgpZddZrT6g8N9GyISwmunzYLyltoMKX5vIALdwPm9j93sT/XNe2ripV+J8W/q+SRd3T Y08uHzsBfECCNdVayt20K0xOWjm36Moqxl5w6Qgb6cLKiesIXA7Mhvo414ssMPgArL72 9Z7Q== X-Gm-Message-State: AKGB3mKb9fR8bVCAx5GGaea13x0mNGYhbJG7h9FeHKnoXIeVm/E7tVVP XPynNPVp0szOqO2SNeIMtxgDtw== X-Google-Smtp-Source: ACJfBosD7gf0kjoSEgldkr+v8z8grJEKMyVtxmMaW6rZNny9k8ssk9k2UqVKa2eyc3YEtpwot7kAUA== X-Received: by 10.107.43.75 with SMTP id r72mr6660606ior.89.1513745551719; Tue, 19 Dec 2017 20:52:31 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: Oddity when completing option arguments after command arguments From: dana In-Reply-To: Date: Tue, 19 Dec 2017 22:52:29 -0600 Cc: zsh-workers@zsh.org Content-Transfer-Encoding: quoted-printable Message-Id: <04DE83CD-E8E7-4D69-9045-DDC2D2CC3263@dana.is> References: To: Marko Myllynen X-Mailer: Apple Mail (2.3273) On 18 Dec 2017, at 06:01, Marko Myllynen wrote: >This is with 5.4.1. What could explain this behavior, any suggestions >how to fix this (so that in the last case would get only filenames)? I think this would do it? I didn't test *super* extensively, but it seems to behave as expected in = all of the cases listed, and it passes the existing checks. dana diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index 71d61563b..0b1ba58dc 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -2493,7 +2493,9 @@ ca_set_data(LinkList descr, LinkList act, LinkList = subc, * the case above right. */ if (arg->type =3D=3D CAA_NORMAL && - opt && optdef && optdef->type =3D=3D CAO_NEXT) + opt && optdef && + (optdef->type =3D=3D CAO_NEXT || optdef->type =3D=3D = CAO_ODIRECT || + optdef->type =3D=3D CAO_OEQUAL)) return; =20 if (single) diff --git a/Test/Y03arguments.ztst b/Test/Y03arguments.ztst index 7cbadfe8c..761b4b1d2 100644 --- a/Test/Y03arguments.ztst +++ b/Test/Y03arguments.ztst @@ -237,6 +237,27 @@ >NO:{-a} >NO:{-b} =20 + tst_arguments '*'{-x+,--xxx=3D}':optarg:(1)' '*:operand:(a)' + comptest $'tst \t' + comptest $'tst -x \t' + comptest $'tst -x\t' + comptest $'tst --xxx=3D\t' + comptest $'tst --xxx \t' + comptest $'tst a -x\t' + comptest $'tst a -x \t' + comptest $'tst a --xxx=3D\t' + comptest $'tst a --xxx \t' +0:optarg completion following rest operand on line (workers/42141) +>line: {tst a }{} +>line: {tst -x 1 }{} +>line: {tst -x1 }{} +>line: {tst --xxx=3D1 }{} +>line: {tst --xxx 1 }{} +>line: {tst a -x1 }{} +>line: {tst a -x 1 }{} +>line: {tst a --xxx=3D1 }{} +>line: {tst a --xxx 1 }{} + tst_arguments '-a' '*::rest:{compadd - -b}' comptest $'tst arg -\t' 0:rest arguments