I need to complete only first level (depth 1) files in given path, and ignore directories. I tried specifying -g '*(.)'
but that seems to have no effect:
#compdef foo
local state
_arguments -S : \
'-i' \
'-l' \
'-w' \
'1: :->myfiles'
case $state in
myfiles)
_files -W /foo/bar -g '*(.)'
;;
esac
it still shows files and directories.
How can I show first level files only ? I am not interested in files that might be in that directories at deeper levels.