From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27533 invoked by alias); 15 Sep 2017 14:57:19 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41709 Received: (qmail 27679 invoked by uid 1010); 15 Sep 2017 14:57:18 -0000 X-Qmail-Scanner-Diagnostics: from sonic305-20.consmr.mail.ir2.yahoo.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(77.238.177.82):SA:0(-1.9/5.0):. Processed in 3.495102 secs); 15 Sep 2017 14:57:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: okiddle@yahoo.co.uk X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1505487429; bh=WDd/328MZBFGgfRF1Y9p55/nV7K797mCBpe7d2DD59Q=; h=From:To:Subject:Date:From:Subject; b=Dj7eKcAg8kcXNtIK3miGSRUCvslN4X3au2oINbcpXS4sWE+io1HxHZaBYnov8ZhsyUYbKHiBdGTcdasHqNcd038+8/MTeZT1w+HI3vlQftexPVektfATLZfK6uk/JF0qIgxT+yTEG5DpljwZt5tY5zvSu4+4oVfQHYg5mkWPetu6yHpg8fJ1t8rugXpEgQY7NV+ZcKN/elI9p51cMME1nsppW2qig14nzauz5wiCSylD1pg6TQayZwtspCljNy89dTRd2SY59sgkGoE5IdQ8acuX8uK20N6YG6L7rE6RR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yP7LNLv6Lk3cHLUTQNjcBvb8tPCAKxZzYWV7VUdQsSvv 60ZLY5v00J_pryh0684RYsZA4PeVUt_HCsDikZocxyEICqA-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- From: Oliver Kiddle To: Zsh workers Subject: PATCH: update completions for Linux sysstat MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5537.1505485601.1@thecus.kiddle.eu> Date: Fri, 15 Sep 2017 16:26:41 +0200 Message-ID: <5538.1505485601@thecus.kiddle.eu> This updates completions for sysstat commands up to version 11.6.0. Mostly this is just a bunch of extra options. With regard to the old comment in there about nfsiostat, I can only find the oracle implementation. The comment about -V appearing with other options doesn't appear to apply any more or at least I couldn't work out what other options it might be combined with. Oliver 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' } diff --git a/Completion/Unix/Command/_iostat b/Completion/Unix/Command/_iostat index 88fc6a103..e95d62f80 100644 --- a/Completion/Unix/Command/_iostat +++ b/Completion/Unix/Command/_iostat @@ -1,6 +1,7 @@ #compdef iostat -local -a args +local -a args parser +parser=( -s -S -A '-*' ) case $OSTYPE:l in *bsd*) @@ -109,23 +110,32 @@ case $OSTYPE:l in ) ;; *linux*) + parser=( -s ) args=( '-c[display CPU utilization report]' '-d[display device utilization report]' - '-T[only display global statistics for group_name]' - '-g[display statistics for a group of devices]:group name' - '-h[human readable device utilization report]' - '-j[display persistent device name]' + '*-g[display statistics for a group of devices]:group name' + '-H[only display global statistics for group]' + '(--human)-h[human readable device utilization report]' + '--human[print sizes in human readable format]' + '-j[display persistent device name]:name type:(ID LABEL PATH UUID)' '(-m)-k[display statistics in kB/s]' '(-k)-m[display statistics in MB/s]' '-N[display registered device mapper names]' + '-o[display statistics in JSON]:format:(JSON)' + '-p[display statistics for block devices]' + '-t[display the time for each report]' + '(- *)-V[display version information]' + '-x[display extended statistics]' + '-y[omit first statistics report following system boot]' + '-z[omit output for devices lacking activity]' '*::device:_files -W /dev -g "*(-%)"' ) ;; esac if (( $#args )); then - _arguments -s -w -A '-*' : $args + _arguments $parser : $args return fi .