Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
_files conditional custom separator
- X-seq: zsh-users 23772
- From: "Pavel S. Mazurin" <kovpas@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: _files conditional custom separator
- Date: Fri, 30 Nov 2018 19:47:00 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:from:date:message-id:subject:to; bh=F6ZJgJI2ZZG3aostsTrqH+8iInnd/3R3fcObtQVzTgk=; b=sMpXvKAAhZWbO4eRtGqZjgZTgE04EL52EjX8yMpbpx6xDxCWDUrxXcJZgCsiDW9ZjP C/RDsp1FCnXtEy0F2xVMJAjR7ueouwYTbRW/0FqakLusJcDaU/Uef8zu1Tx6MA/PnhG2 QCZGFPmKvBQD9mjgOLmxG2ZzbiRWUVSgIL3DuqU4DRff2PkpXJN2fdFojLdKmDeOSSwc VXQokJu/7TOGNqKrd1vDwcz75Z/4myoL1Bccw5yPfRYLYE8tXdy2cyzpD/xKH+v+xMSS 4zXOIOfh1asHHVOqkBXy4/6zOGuv+EIkH+RgsArAG/tok8o/cRvOzaAPP7tNbsG0pzEd sfRg==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Reply-to: kovpas@xxxxxxxxx
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author