My script takes optional parameters (-i, -w) and a filename in a given directory. How can I tell zsh to complete only regular files (not directories or symlinks) in $HOME/data
This is what I have in my /usr/share/zsh/functions/Completion/Unix/_my-script
.
#compdef my-script
_my-script() {
integer ret=1
local -a args
args+=(
'-i[case insensitive]'
'-w[match whole words]'
)
_arguments $args[@] && ret=0
return ret
}
_my-script
where do I add the _files
and how do I tell zsh
to only complete regular files in $HOME/data
?
Also, I assume the firs line #compdef my-script
is not a comment. How can I add comment to my completion file?