zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] completion: Add FreeBSD's watch(1)
@ 2015-05-23 10:15 Daniel Shahaf
  2015-06-01 22:19 ` Oliver Kiddle
  2015-06-11 11:24 ` [PATCH] completion: Add FreeBSD's watch(1) Daniel Shahaf
  0 siblings, 2 replies; 7+ messages in thread
From: Daniel Shahaf @ 2015-05-23 10:15 UTC (permalink / raw)
  To: zsh-workers

There's a completion for the linux watch(1) at
<https://github.com/zsh-users/zsh-completions/blob/master/src/_watch>.

We may need a _ttys function.

diff --git a/Completion/BSD/Command/_watch-freebsd b/Completion/BSD/Command/_watch-freebsd
new file mode 100644
index 0000000..7302051
--- /dev/null
+++ b/Completion/BSD/Command/_watch-freebsd
@@ -0,0 +1,21 @@
+#autoload
+
+# watch [-cinotW] [-f snpdev] [tty]
+
+# TODO: complete /dev/**/*(+isatty); the following also do so:
+#     Unix/Command/_pgrep
+#     Unix/Command/_gdb
+#     Unix/Command/_qemu
+#     Unix/Command/_ps
+#     Unix/Command/_last
+#     Unix/Type/_ps1234
+
+_arguments -w -S -s : \
+  "-c[Reconnect on close]" \
+  "-f:snp(4) device: " \
+  "-i[Force interactive mode even when stdout is not a tty]" \
+  "-n[Disable the ability to switch the watched tty interactively]" \
+  "-o[Reconnect on overflow]" \
+  "-t[Print date and time at start]" \
+  "-W[Allow write access to observed tty]" \
+  ":tty device: "
diff --git a/Completion/Unix/Command/_watch b/Completion/Unix/Command/_watch
new file mode 100644
index 0000000..7595dac
--- /dev/null
+++ b/Completion/Unix/Command/_watch
@@ -0,0 +1,9 @@
+#compdef watch
+
+# watch(1) has completely different semantics on freebsd compared to linux, hence:
+case $OSTYPE in
+  (freebsd*)  _watch-freebsd "$@"; return $?;;
+  (*)         return 1;;
+esac
+
+# NOTREACHED


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-06-11 16:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-23 10:15 [PATCH] completion: Add FreeBSD's watch(1) Daniel Shahaf
2015-06-01 22:19 ` Oliver Kiddle
2015-06-11 12:09   ` bug with hidden prefixes Oliver Kiddle
2015-06-11 15:45     ` Bart Schaefer
2015-06-11 15:53       ` Roman Neuhauser
2015-06-11 16:35         ` Bart Schaefer
2015-06-11 11:24 ` [PATCH] completion: Add FreeBSD's watch(1) Daniel Shahaf

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).