about summary refs log tree commit diff
path: root/Completion/BSD
diff options
context:
space:
mode:
authorEric Cook <llua@gmx.com>2015-08-05 16:04:31 +0200
committerOliver Kiddle <opk@zsh.org>2015-08-05 16:05:36 +0200
commit31c1ebe7b297b63e0fd8c8c134b895dcdad91628 (patch)
treef16d3a521c93d5bfdd288268c05b679350e3222a /Completion/BSD
parent764c48f54dfe0a04f18330b0b12f16a894ff34cb (diff)
downloadzsh-31c1ebe7b297b63e0fd8c8c134b895dcdad91628.tar.gz
zsh-31c1ebe7b297b63e0fd8c8c134b895dcdad91628.tar.xz
zsh-31c1ebe7b297b63e0fd8c8c134b895dcdad91628.zip
35973: new systat and vmstat completions
Diffstat (limited to 'Completion/BSD')
-rw-r--r--Completion/BSD/Command/_systat88
1 files changed, 88 insertions, 0 deletions
diff --git a/Completion/BSD/Command/_systat b/Completion/BSD/Command/_systat
new file mode 100644
index 000000000..c8348c7f7
--- /dev/null
+++ b/Completion/BSD/Command/_systat
@@ -0,0 +1,88 @@
+#compdef systat
+
+local -a screens args opts
+local pre
+case $OSTYPE in
+  freebsd*)
+    pre=-
+    screens=(
+      'pigs:processes consuming the most CPU time'
+      icmp{6,}':ICMP statistics'
+      ip{6,}':IP and UDP statistics'
+      'tcp:TCP statistics'
+      'iostat:processor and disk statistics'
+      'swap:swap space statistics'
+      'vmstat:virtual memory statistics'
+      'netstat:network connection statistics'
+      'ifstat:network traffic statistics'
+    )
+  ;;
+  openbsd*)
+    screens=(
+      'buckets:kernel malloc(9) bucket statistics'
+      'cpu:per CPU, usage statistics'
+      'ifstat:interface statistics'
+      'iostat:disk throughput statistics'
+      'malloc:malloc(9) type statistics'
+      'mbufs:mbuf usage statistics'
+      'netstat:network connection statistics'
+      'nfsclient:NFS client statistics'
+      'nfsserver:NFS server statistics'
+      'pf:pf(4) filter statistics'
+      'pigs:processes consuming the most CPU time'
+      'pool:pool(9) statistics'
+      'queues:pf(4) queue statistics'
+      'rules:pf(4) rule statistics'
+      'sensors:display hardware sensors values'
+      'states:pf(4) states statistics'
+      'swap:swap space usage'
+      'vmstat:virtual memory statistics'
+    )
+    opts=(
+      '-a[display all lines]'
+      '-B[raw, non-interactive mode (two screen updates)]'
+      '-b[raw, non-interactive mode (one screen update)]'
+      '-d[exit after `count'\'' updates]:count'
+      '-i[interactive mode]'
+      '-N[resolve network addresses to names]'
+      '-n[do not resolve network addresses to names]'
+      '-s[screen refresh interval]:refresh interval (seconds)'
+      '-w[maximum width of output in raw mode]:width'
+    )
+  ;;
+  netbsd*)
+    screens=(
+      'all:cycle through all displays'
+      'bufcache:filesystem buffer statistics'
+      'df:disk usage statistics'
+      'inet.icmp:ICMP statistics'
+      'inet.ip:IPv4 and UDP statistics'
+      'inet.tcp:TCP statistics'
+      'inet.tcpsyn:TCP ``syncache'\'\'' statistics'
+      'inet6.ip6:IPv6 statistics'
+      'iostat:disk throughput statistics'
+      'mbufs:mbuf usage statistics'
+      'netstat:network connection statistics'
+      'pigs:processes consuming the most CPU time'
+      'ps:``ps -aux'\'\'' in a loop'
+      'swap:swap space usage'
+      'syscall:per system call statistics'
+      'vmstat:virtual memory statistics'
+    )
+    opts=(
+      '-M[alternative source to extract values from]:core:_files'
+      '-N[alternative source to extract the name list from]:system:_files'
+      '-n[do not resolve IP addresses]'
+      '-w[refresh interval]:refresh interval'
+      '-t[the amount of refreshes for each screen in '\''all'\'' display mode]:turns'
+    )
+esac
+
+if (( $#screens )); then
+  _arguments -M 'r:|.=* r:|=*' : $opts \
+    '1:systat(1) displays:(( ${pre}$^screens ))' \
+    '2:refresh interval'
+  return
+fi
+
+_default