about summary refs log tree commit diff
path: root/Completion/Linux
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2017-09-15 18:31:11 +0200
committerOliver Kiddle <opk@zsh.org>2017-09-15 18:31:11 +0200
commit9429663af32488ce81aee19ac04697b07fc241ab (patch)
tree64468c31d31df022b3f5b78e111f0ee373078111 /Completion/Linux
parentc2d4fa50edf47c87e22189323f01794260f8b0fe (diff)
downloadzsh-9429663af32488ce81aee19ac04697b07fc241ab.tar.gz
zsh-9429663af32488ce81aee19ac04697b07fc241ab.tar.xz
zsh-9429663af32488ce81aee19ac04697b07fc241ab.zip
41709: update options in Linux sysstat completions
Diffstat (limited to 'Completion/Linux')
-rw-r--r--Completion/Linux/Command/_sysstat70
1 files changed, 46 insertions, 24 deletions
diff --git a/Completion/Linux/Command/_sysstat b/Completion/Linux/Command/_sysstat
index e976b4705..855bf0a70 100644
--- a/Completion/Linux/Command/_sysstat
+++ b/Completion/Linux/Command/_sysstat
@@ -1,15 +1,17 @@
 #compdef mpstat cifsiostat isag sadf sar pidstat
-# -V can appear with other options, so (- *) isn't needed.
 #TODO:
 # sysstat-nfsiostat - there seems to be two nfsiostat(1)s. one from oracle and one by redhat.
 
 _mpstat() {
-  _arguments : \
-    '-A[equivalent to -u -I ALL -P ALL]' \
-    '-I[report interrupt statistics]:interrupt:(SUM CPU SCPU ALL)' \
-    '-P[specify processor number]:processor: _values -s "," processor ON ALL {1..$(_call_program processors getconf _NPROCESSORS_ONLN)}' \
+  _arguments -S : \
+    '(-n -u -I -N -P)-A[equivalent to -n -u -I ALL -N ALL -P ALL]' \
+    '(-A)-I[report interrupt statistics]:interrupt:(SUM CPU SCPU ALL)' \
+    '(-A)-N[specify NUMA nodes]:NUMA node' \
+    '(-A)-n[report summary CPU statistics based on NUMA node placement]' \
+    '-o[display statistics in JSON]:format:(JSON)' \
+    '(-A)-P[specify processor number]:processor: _values -s "," processor ON ALL {0..$(_call_program processors getconf _NPROCESSORS_ONLN)}' \
     '-u[report CPU utilization]' \
-    '-V[print version number]' \
+    '(- 1 2)-V[display version information]' \
     '1: : _guard "^-*" interval' \
     '2: : _guard "^-*" count'
 }
@@ -20,7 +22,8 @@ _cifsiostat() {
     '(-m)-k[display statistics in kB/s]' \
     '(-k)-m[display statistics in MB/s]' \
     '-t[print timestamp for each report]' \
-    '-V[print version number]' \
+    '(- 1 2)-V[print version number]' \
+    '--human[print sizes in human readable format]' \
     '1: : _guard "^-*" interval' \
     '2: : _guard "^-*" count'
 }
@@ -34,50 +37,62 @@ _isag() {
 }
 
 _sadf() {
-  local ret=1
+  local i ret=1
   # any options after `--' are for sar(1)
-  if ! (( CURRENT > $words[(i)--] )); then
+  if (( CURRENT <= $words[(i)--] )); then
     _arguments : \
       '-C[display comments in file]' \
-      '(-j -p -x)-d[output file in SQL format]' \
+      '-c[convert an old datafile to the new format]' \
       '-e[set ending time of report]:ending time (HH\:MM\:SS)' \
       '-H[display only the header of the report]' \
-      '(-j -p -x)-h[print on a single line when used with -d]' \
-      '(-d -p -x)-j[output file in JSON]' \
+      '(-g -j -p -r -x)-h[print on a single line when used with -d]' \
+      '-O[specify output options]: : _values -s , option
+        autoscale height\:value oneday packed showidle showinfo skipempty showhints' \
       '-P[restrict processor dependant statistics]:processor number(zero indexed) or ALL:(ALL)' \
-      '(-j -x -d)-p[print in format parsable by tools like awk]' \
       '-s[set starting time of report]:starting time (HH\:MM\:SS)"' \
       '(-t -U)-T[display timestamp in local time]' \
       '(-T -U)-t[display timestamp in file\''s original localtime]' \
       '(-t -T)-U[display in seconds since epoch (UTC)]' \
-      '-V[print version number]' \
-      '(-j -d -p)-x[output file in XML]' \
+      '(- 1 2 3)-V[print version number]' \
       '1: : _guard "^-*" interval' \
       '2: : _guard "^-*" count' \
-      '3:data file:_files' && ret=0
+      '3:data file:_files' \
+      + '(format)' \
+      '-d[output file in SQL format]' \
+      '-g[print data in SVG format]' \
+      '-j[output file in JSON]' \
+      '-p[print in format parsable by tools like awk]' \
+      '-r[print raw contents of data file]' \
+      '-x[output file in XML]' \
+      && ret=0
   else
-    _arguments : '*::sar: _sar' && ret=0
+    (( i = words[(i)--] - 1, CURRENT -= i ))
+    shift i words
+    _sar && ret=0
   fi
   return ret
 }
 
 _sar() {
-  _arguments : \
-    '-A[equivalent to -bBdFHqrRSuvwWy -I SUM -I XALL -m ALL -n ALL -u ALL -P ALL]' \
+  _arguments -s : \
+    '-A[equivalent to -bBdFHqrRSuvwWy -I SUM -I XALL -m ALL -n ALL -r ALL -u ALL -P ALL]' \
     '-B[report paging statistics]' \
     '-b[report I/O and transfer rate statistics]' \
     '-C[display comments from sadc]' \
+    '-D[use saYYYYMMDD instead of saDD as the standard system activity daily data file name]' \
     '-d[report activity for each block device]' \
     '-e[set ending time of report]:ending time (HH\:MM\:SS)' \
     '-F[display statistics for mounted filesystems]' \
     '-f[extract records from file]:record:_files' \
     '-H[report hugepages utilization]' \
     '-h[display help]' \
+    '--human[print sizes in human readable format]' \
     '*-I[report statistics for interrupts]:interrupts: _values -s "," interrupts 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 SUM ALL XALL' \
     '-i[select records as close as possible to interval]:interval' \
     '-j[display persistent device names]:type:(ID LABEL PATH UUID)' \
     '-m[report power management statistics]:keywords: _values -s "," keywords CPU FAN FREQ IN TEMP USB ALL' \
     '-n[report network statistics]:keywords: _values -s "," keywords DEV EDEV NFS NFSD SOCK IP EIP ICMP EICMP TCP ETCP UDP SOCK6 IP6 EIP6 ICMP6 EICMP6 UDP6 ALL' \
+    '-o[save readings to file in binary form]:file:_files' \
     '-P[report per-processor statistics]:processor: _values -s "," processors ALL' \
     '-p[pretty-print device names]' \
     '-q[report queue length and load averages]' \
@@ -85,8 +100,10 @@ _sar() {
     '-r[report memory utilization statistics]' \
     '-S[report swap space utilization]' \
     '-s[set starting time of report]:start time (HH\:MM\:SS)' \
+    '--sadc[print name of data collector]' \
+    '-t[display timestamps in original local time of file creator]' \
     '-u[report CPU utilization]: :(ALL)' \
-    '-V[print version number]' \
+    '(- 1 2)-V[display version information]' \
     '-v[report status of kernel tables]' \
     '-W[report swapping statistics]' \
     '-w[report task creation and system switching activity]' \
@@ -96,22 +113,27 @@ _sar() {
 }
 
 _pidstat() {
-  _arguments : \
+  _arguments -s : \
     '-C[filter tasks by string]:task filter' \
     '-d[report I/O statistics]' \
-    '-h[display on horizontally]' \
+    '-e[execute specified program and monitor it with pidstat]:*::command: _normal' \
+    '-H[display timestamp in seconds since the epoch]' \
+    '-h[display horizontally]' \
     '-I[divide CPU usage by number of processors]' \
     '-l[display process name along with arguments]' \
-    '-p[select pid]:pid: _sequence _pids' \
+    '*-p[select pid]:pid: _sequence _pids' \
+    '-R[report realtime priority and scheduling policy information]' \
     '-r[report page faults and memory]' \
     '-s[report stack utilization]' \
     '-T[specifies what to monitor]:type:(TASK CHILD ALL)' \
     '-t[display statistics for threads]' \
     '-U[display real username of tasks]::username:_users' \
     '-u[report cpu utilization]' \
-    '-V[print version number]' \
+    '(- 1 2)-V[display version information]' \
     '-v[display values from kernel table]' \
     '-w[report task switching activity]' \
+    '-G[include only processes with specified name]:process name' \
+    '--human[print sizes in human readable format]' \
     '1: : _guard "^-*" interval' \
     '2: : _guard "^-*" count'
 }