zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: [PATCH] completion: Add FreeBSD's watch(1)
Date: Sat, 23 May 2015 10:15:55 +0000	[thread overview]
Message-ID: <20150523101555.GF1889@tarsus.local2> (raw)

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


             reply	other threads:[~2015-05-23 10:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-23 10:15 Daniel Shahaf [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150523101555.GF1889@tarsus.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).