From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 354 invoked from network); 18 Apr 2020 23:24:54 -0000 Received-SPF: pass (primenet.com.au: domain of zsh.org designates 203.24.36.2 as permitted sender) receiver=inbox.vuxu.org; client-ip=203.24.36.2 envelope-from= Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with UTF8ESMTPZ; 18 Apr 2020 23:24:54 -0000 Received: (qmail 14340 invoked by alias); 18 Apr 2020 23:24:40 -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: List-Unsubscribe: X-Seq: 24797 Received: (qmail 29498 invoked by uid 1010); 18 Apr 2020 23:24:40 -0000 X-Qmail-Scanner-Diagnostics: from mail-vs1-f65.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.2/25779. spamassassin: 3.4.4. Clear:RC:0(209.85.217.65):SA:0(-2.8/5.0):. Processed in 2.28692 secs); 18 Apr 2020 23:24:40 -0000 X-Envelope-From: sgniazdowski@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.217.65 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DHTdICXl/GrFQArJKpBVAtxGhSF+cwJmMO8kEWzrg/0=; b=q1Anc+pKYS5j8YPqwpmHcCzsC1bTavxahPzW8JwrxR7496OcJ6qp44d240lIZCQO/U TiHL32kjjDrXw8/75HKoZepOYOFZ3ezc6Qe9Lsd9+EBsowxsjEo5e2Y6DVhK8MdQvANg qanslOTrvYIL+n6mIiO1ccEpr1UgCxXEZUT38J/n8MVIOmcsFYUu8db4RX+q26bVEtnv EjzKu5OJerKhEgtT1rFj4n/hZ3DiV5a1o8QfEXAk/g8pAgi/96Uh0x9CykZhqFW+fZRA E68oLbmzq+1eTnUHP1lIkJ41iqjcFeF/krQBDJe2ilm9RGzEjDlDEtN9J4FcrhI2HhLT Ubng== X-Gm-Message-State: AGi0PubacY5XVvFaWehpPalKigPTZKP+rvJB4aCqRvfucB1u9LwhCpc8 sQRay0iT1KqLa4aQqk1+R2C7bpCFuyUTNuSNxvI= X-Google-Smtp-Source: APiQypLyS7860oVS05tY/0ATI0PZ+h4lQ6WQKfewR1cCax0sS2GxhuQbvnxOWut+/4yWiG2jIsDvD0fJSycvDY0d0Jw= X-Received: by 2002:a67:e94d:: with SMTP id p13mr4432289vso.215.1587252244779; Sat, 18 Apr 2020 16:24:04 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Sebastian Gniazdowski Date: Sun, 19 Apr 2020 01:22:24 +0200 Message-ID: Subject: =?UTF-8?B?UmU6IEhvdyB0byBvdmVyY29tZSB0aGUgKGEvYi9j4oCmKShOKSBwYXR0ZXJuIGxpbWl0YQ==?= =?UTF-8?B?dGlvbj8=?= To: Bart Schaefer Cc: Roman Perepelitsa , Zsh Users Content-Type: multipart/alternative; boundary="00000000000038154105a398f6bb" --00000000000038154105a398f6bb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, 18 Apr 2020 at 22:00, Bart Schaefer wrote: > On Sat, Apr 18, 2020 at 5:51 AM Sebastian Gniazdowski > wrote: > > > > I was trying to do: ls (/tmp/somedir/gh|./gh)(N) to obtain the error > > message: > > > > zsh: bad pattern: (/tmp/somedir/gh|./gh)(N) > > Just making sure you don't mean that you were trying to obtain the > error message? If you did mean that, what did you get instead? > No, I didn't want to obtain the error, so I guess that your first impression was correct. > On Sat, Apr 18, 2020 at 7:43 AM Sebastian Gniazdowski > wrote: > > > > Yes, but as I wrote, such patterns are useful, good ones and I'm lookin= g > > for an alternative form for them. > > In this case, "useful" collides directly with "practical" given the > semantics of "/" imposed by the underlying file system. > What do you mean? In the big, complete picture the user installs a binary-release, GitHub plugin. It can come either from a deb/rpm file or from a tar.gz. If it comes from deb (selected when the system has dpkg-deb), then the binary will be located in plugin-dir/usr/bin/gh, if from tarball then in plugin-dir/gh. So to match the file with the pick ice-mod =E2=80=93 Zinit's (formerly Zplugin) tool to select the binary that= should be added to PATH =E2=80=93 an alternative (usr/bin/gh|gh) comes to mind. Th= e issue has resolved by using **/gh, however it puzzled me that such /-using patterns aren't allowed. Mikachu has a patch allowing them, maybe it's worth adding it to the upstream?: http://comm.it.cx/cgit/zsh-cvs/commit/?h=3Dmika&id=3D512bd3f23ea8b4170d8858= 2521d417cdb247413a > > list=3D( ${(M)~ZINIT_ICE[pick]##/*}(DN) > > $local_dir/$dirname/${~ZINIT_ICE[pick]##/*}(DN.) ) > > I'm a little puzzled about what the contents of ZINIT_ICE[pick] look > like. Do you not want this to work for (.gh|/tmp/gh) as well as the > reverse? > It can be either an absolute path, like "$ZPFX/bin/something" (where ZPFX is ~/.zinit/polaris by default) or an pattern that'll be applied inside the plugin directory. If it's a simple list of alternatives without nested parens, you > should be able to do this: > > list=3D( > ${^~${(s:|:)ZINIT_ICE[pick]}//(#b)(#s)([^\/]*)/$local_dir\/$dirname\/$mat= ch(#q.)}(DN) > ) > Thanks, I'll think about extending pick''. --=20 Sebastian Gniazdowski News: https://twitter.com/ZdharmaI IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zinit Blog: http://zdharma.org --00000000000038154105a398f6bb--