zsh-users/zsh-completions — pull request #229 by fishilico (2014-05-05 18:29:29+00:00)
Title: Add watch completion

Hello, I'm using ``watch`` (from procps project, https://gitorious.org/procps/procps/) to execute a program periodically and see its output. This program hasn't got any zsh completion script that I'm aware of so I've written one a few days ago. This is my first completion script and it is highly likely that I missed something when I wrote it, so please review it carefully before merging.

With this new script there is something which doesn't work as I would expect but I don't know whether it's due to my script or to zsh internals. When hitting TAB after ``watch -n 1 `` zsh tries to complete "external command" as expected, but when hitting TAB after ``watch -n1 `` (no space between "n" and "1"), zsh tries to complete "file" instead. How could this strange behavior be fixed?

For your information, I've used parts of the ``_sudo`` script to copy the behavior "complete a command after the options" (https://github.com/zsh-users/zsh/blob/master/Completion/Unix/Command/_sudo) and used ``watch --help`` and ``man watch`` to list the optional parameters.