* _files conditional custom separator
@ 2018-11-30 18:47 Pavel S. Mazurin
0 siblings, 0 replies; only message in thread
From: Pavel S. Mazurin @ 2018-11-30 18:47 UTC (permalink / raw)
To: zsh-users
[-- Attachment #1: Type: text/plain, Size: 642 bytes --]
I'm trying to create a completion script for buck
<https://github.com/facebook/buck>. In essence, I want to be able to
complete the following format:
buck //path/to/my/buck/file:TargetName
I managed to make completion work for the most part: I can complete
everything up to the TargetName:
buck //path/to/my/buck/file/
with the following script:
if compset -P '//'; then
_files -/
fi
The problem is that _files adds this / in the end of the path. However, I
want to have a check: if the path contains a BUCK file, I want this slash
to be replaced with a colon:
buck //path/to/my/buck/file:
Is there any way to achieve this?
-Pavel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-11-30 18:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-30 18:47 _files conditional custom separator Pavel S. Mazurin
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).