Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] completion: Add FreeBSD's watch(1)
- X-seq: zsh-workers 35274
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] completion: Add FreeBSD's watch(1)
- Date: Sat, 23 May 2015 10:15:55 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=wfx zXIDpfpzxK5Abw6w+3hQyPr0=; b=uuvchm5algeu08leaNnAMdzu6N9qMYOZ1rO qvZCvM9vtVzAdZhk+E31paPCfYbLE6dVO6gfMgm/Qf6xuuqUZjdL5xM3unxSMrwt B8o9efXnqPf7ituEHMkVt3XTP43Pd/OgwRTihpUARGW/pHtdSSPWp1XZYCfMfqej QZFgj0oA=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=wf xzXIDpfpzxK5Abw6w+3hQyPr0=; b=pULbmscxujoxThReXhnskCffibqCkauK6W HqY9eBTBuQW6qsYgXPOz3xo1iPBeSzlVD1Qw9YgF1FBvg9pEmPRqF3CcuDga0S8D rWQ3aW8FtgY9Ejo4/7SKNkWOm/PxgdcUDX1IW0/m9iRm0p2a56Pcl0CYggJRKLIo 3q6EzafS8=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author