From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21284 invoked by alias); 18 Aug 2017 17:10:09 -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: 41568 Received: (qmail 17183 invoked by uid 1010); 18 Aug 2017 17:10:09 -0000 X-Qmail-Scanner-Diagnostics: from nm20-vm7.bullet.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(212.82.96.249):SA:0(-4.7/5.0):. Processed in 4.714033 secs); 18 Aug 2017 17:10:09 -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=-4.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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=1503075869; bh=h3BMDTi2TyQ4jXYG01IUcrIwcuOauWv68SDYs6Hlpwc=; h=Date:From:To:Subject:From:Subject; b=KU9OtUUWFSceizAqnumiLI+a9EFUyIM5v81BYyYeix7vQcgpnT6LC4W/yOjGSWDoPYfnwxgYYrTb70XTXLPBtrzDfZKGNAIXIY7PvLsFvlLnb/uqFEdjc7aT/lGd9ATOz8AAqIjJXSeAEZBxGhj0nYf0Zm7k+2NItle/5c2/UXXrWyGYs3zI32oF0MLfHvpIir2A+eFNKLlXSddNkb2VqOQNrkLXE56p+QZz74AocIzkbK4bTaJy5l6aMKWsY7lmE6eqzob/QwtsouLfu/3QSmCmFaEDJAhhxKwQxwvwJITXq5gNkOEddRUDRRV4FavwraZpXxsRjmwwujuJgFfkfw== X-Yahoo-Newman-Id: 659265.11422.bm@smtp119.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: MBLXyJUVM1ncx81F0CsKG0y9QxCH6z3ggqJ17BWR7PTJQUS r952MqzMu35p0TLXQi85omQ6HDHhWJoHJdzmkPaVZefl.gT15Y5_UnytpfFv .tnhB_K5lf5L_txk6sjJDIaSyphrZDP2fhQKh1aqYtllcC9KFQMvzG5jYxtG jHOxGB560dlfRIoodO_lWNfYNa2K8qjb0vMDyKfsPMfXdTRYERxN0AJCFKJY YyTilxgERO1l_6qX_gLHd8Z5eKRxkdGMI9zlmmkikehLF8_O5_Oo431STDmq GaZ9zIdzwOO1e6CV3xOtp1a5XuTgXH2DkMyCzx3Dmam3YYXs_npgBSntmpO7 jNvFrU1304rhzVTmdIApMeiZ3T8BQyDjMjvm.cQ.ZgeWbkPRBCCFRch1fPNr HQtN5dcFTQa0zGKo0sztlNzSZ2nvRhqyhWoucHtrcFbtbGsiXflmZSIL0x17 6CQkeu4FX_sX01hKDXC.ofQym.hMfyQCaa2FvdB6wxogZQQ-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- Date: Fri, 18 Aug 2017 19:04:17 +0200 From: Oliver Kiddle To: Zsh workers Subject: PATCH: in vmstat completion handle Solaris and NetBSD Message-Id: User-Agent: mblaze/0.2-9-g13db677-dirty (2017-08-09) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Also added exclusion lists and other improvements. Oliver diff --git a/Completion/Unix/Command/_vmstat b/Completion/Unix/Command/_vms= tat index 7082cbbd5..7d3008592 100644 --- a/Completion/Unix/Command/_vmstat +++ b/Completion/Unix/Command/_vmstat @@ -4,28 +4,31 @@ local -a specs case $OSTYPE in *linux*) specs=3D( - '(-a --active)'{-a,--active}'[active/inactive memory]' - '(-f --forks)'{-f,--forks}'[number of forks since boot]' - '(-m --slabs)'{-m,--slabs}'[slabinfo]' - '(-n --one-header)'{-n,--one-header}'[do not redisplay header]' - '(-s --stats)'{-s,--stats}'[event counter statistics]' - '(-d --disk)'{-d,--disk}'[disk statistics]' - '(-D --disk-sum)'{-D,--disk-sum}'[summarize disk statistics]' - '(-p --partition)'{-p,--partition}'[partition specific statistics]:p= artition:_files' - '(-S --unit)'{-S+,--unit}'[define display unit]:unit prefix:(( k\:10= 00 K\:1024 m\:1000000 M\:1048576 ))' '(-w --wide)'{-w,--wide}'[wide output]' '(-t --timestamp)'{-t,--timestamp}'[show timestamp]' - '1:delay' '2:count' + '(-n --one-header)'{-n,--one-header}'[do not redisplay header]' + '(-S --unit)'{-S+,--unit=3D}'[specify unit for displayed sizes]:unit= prefix [K]:((k\:1000 K\:1024 m\:1000000 M\:1048576))' + '1: :_guard "[0-9]#" "interval (seconds)"' '2:count' + + '(action)' \ + '(- :)'{-h,--help}'[display help information]' + '(- :)'{-V,--version}'[display version information]' + {-a,--active}'[show active/inactive memory]' + '(- :)'{-f,--forks}'[show number of forks since boot]' + '(-S --unit -t --timestamp -w --wide)'{-m,--slabs}'[show slabinfo]' + '(-w --wide -n --one-header -t --timestamp :)'{-s,--stats}'[show eve= nt counter statistics]' + {-d,--disk}'[show disk statistics]' + {-p+,--partition=3D}'[show partition specific statistics]:partition:= _files -W /dev -g "*(-%)"' + '(- :)'{-D,--disk-sum}'[summarize disk statistics]' ) ;; - freebsd*|openbsd*) + *bsd*) specs=3D( - '-c[number of times to refresh the display]:count' + '-c+[specify number of times to refresh the display]:count' '-f[report on the number fork syscalls since boot and pages of virtu= al memory for each]' '-i[report the number of interrupts taken by devices since boot]' - '-M[source file to extract values associated with the name list from= ]:core:_files' - '-N[source file to extract the name list from]:system:_files' - '-w[specify delay between each display]:delay (seconds)' + '-M+[specify core file to extract values associated with the name li= st from]:core:_files' + '-N+[specify file to extract the name list from]:system:_files' + '-w+[specify delay between each display]:delay (seconds)' '*:disk:_files' ) ;| @@ -35,23 +38,60 @@ case $OSTYPE in '-h[human readable memory columns output]' '-H[scriptable memory columns output]' '-m[report on the usage of kernel dynamic memory allocated using mal= loc(9) by type]' - '-n[change the maximum number of disks to display]:number of disks t= o display' + '-n+[change the maximum number of disks to display]:number of disks = to display' '-o[list virtual memory objects]' '-P[report per-cpu system/user/idle cpu statistics]' - '-p[specify which types of devices to display]: :->devices' - '-s[display the contents of the SUM structure]:sum' + '-p+[specify which types of devices to display]: :->devices' + '-s[display the contents of the SUM structure]' '-z[report on memory used by the kernel zone allocator, uma(9), by z= one]' ) - ;; - openbsd*) + ;| + (net|open)bsd*) specs+=3D( '-m[report usage of kernel dynamic memory listed first by size of al= location then type of usage]' - '-s[display the contents of the UVMEXP structure]:uvmexp' - '-t[report on the number of page in and page reclaims since boot]' + '-s[display the contents of the UVMEXP structure]' '-v[print more verbose information]' + ) + ;| + openbsd*) + specs+=3D( + '-t[report on the number of page in and page reclaims since boot]' '-z[include statistics about all interrupts]' ) ;; + netbsd*) + specs+=3D( + '-C[report on kernel memory caches]' + '-e[report the values of system event counters]' + '-H[report all hash table statistics]' + '-h+[dump specified hash table]:hash table:->hashes' + '-L[list all hash tables]' + '-l[list UVM histories maintained by the kernel]' + '-t[display contents of the vmtotal structure]' + '-U[dump all UVM histories]' + '-u+[dump specified UVM history]:uvm' + '-W[print more information about kernel memory pools]' + ) + ;; + freebsd*|solaris*) + specs+=3D( + '::disk:_files -W /dev -g "*(-%b)"' + ': :_guard "[0-9]#" "interval (seconds)"' ':count' + ) + ;| + solaris2.<11->) + specs+=3D( '(-i -s)-T+[specify time format]:time format:((u\:seconds\ = since\ epoch d\:standard\ date\ format))' ) + ;& + solaris*) + specs+=3D( + '-q[suppress messages related to state changes]' + + '(actions)' \ + '(-T)-i[report the number of interrupts taken by devices since boot]= ' + '-p[report paging activity]' + '(-T)-s[display the total number of system events since boot]' + '-S[report on swapping rather than paging activity]' + ) + ;; esac = if (( $#specs )); then @@ -73,7 +113,11 @@ if (( $#specs )); then 'SCSI[Small Computer System Interface devices]' 'other[any other device interface]' 'pass[passthrough devices]' ) - _values -C -s , 'device type' "$types[@]" && ret=3D0 + _values -s , 'device type' "$types[@]" && ret=3D0 + elif [[ $state =3D=3D hashes ]]; then + local -a tables + tables=3D( ${${${(f)"$(_call_program hashes $words[1] -L)"}[2,-1]#?}/ #= #/:} ) + _describe -t hashes 'hash table' tables && ret=3D0 fi return ret fi