1

I would like to write a ZSH completion where one of the arguments must be an executable file.

While :_files works well enough to list all files, there does not appear to be an easy way to list only executable files. The glob expression ls *(*) does this, but I'm not sure how to apply this filter to :_files.

Zach Riggle
  • 2,975
  • 19
  • 26

1 Answers1

1

It looks like _files can take a glob expression with the -g flag.

The resulting autocomplete action then looks like :_files -g "*(*)", where (*) is the glob modifier for executable files.

Zach Riggle
  • 2,975
  • 19
  • 26