From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 6fe30c1b for ; Wed, 20 Mar 2019 09:56:12 +0000 (UTC) Received: (qmail 15324 invoked by alias); 20 Mar 2019 09:55:57 -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: List-Unsubscribe: X-Seq: 44147 Received: (qmail 11583 invoked by uid 1010); 20 Mar 2019 09:55:56 -0000 X-Qmail-Scanner-Diagnostics: from rcpt-expgw.biglobe.ne.jp by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.1/25393. spamassassin: 3.4.2. Clear:RC:0(133.208.98.1):SA:0(-2.6/5.0):. Processed in 2.778182 secs); 20 Mar 2019 09:55:56 -0000 X-Envelope-From: takimoto-j@kba.biglobe.ne.jp X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at spf01.biglobe.ne.jp designates 133.208.98.1 as permitted sender) X-Biglobe-Sender: From: Jun T Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: [PATCH] Add/update completions for procps-ng Message-Id: <6EAD3556-C3BE-4021-9A1E-F931E4A08235@kba.biglobe.ne.jp> Date: Wed, 20 Mar 2019 18:55:17 +0900 To: zsh-workers@zsh.org X-Mailer: Apple Mail (2.3445.102.3) X-Biglobe-Spnum: 62293 New completions: _free, _pmap, _slabtop, _tload. Update _top. All are based on procps-ng-3.3.15. _top also includes a few new sort keys for darwin/freebsd. diff --git a/Completion/Linux/Command/_free = b/Completion/Linux/Command/_free new file mode 100644 index 000000000..cc5bcf3bd --- /dev/null +++ b/Completion/Linux/Command/_free @@ -0,0 +1,25 @@ +#compdef free +# based on procps-ng-3.3.15 + +_arguments -s \ + '(-l --lohi)'{-l,--lohi}'[show detailed low and high memory = statistics]' \ + '(-t --total)'{-t,--total}'[show total for RAM + swap]' \ + '(-w --wide)'{-w,--wide}'[wide mode]' \ + '(-s --seconds)'{-s,--seconds}'[specify the delay between = display]:seconds: ' \ + '(-c --count)'{-c+,--count=3D}'[specify the display count]:count: ' \ + '--si[use power of 1000 instead of power of 1024]' \ + '(-)--help[print help and exit]' \ + '(-)'{-V,--version}'[print version information and exit]' \ + + '(unit)' \ + {-b,--bytes}'[display the amount of memory in bytes]' \ + {-k,--kibi}'[display the amount of memory in kibibytes (default)]' \ + {-m,--mebi}'[display the amount of memory in mebibytes]' \ + {-g,--gibi}'[display the amount of memory in gibibytes]' \ + '--tebi[display the amount of memory in tebibytes]' \ + '--pebi[display the amount of memory in pebibytes]' \ + '(--si)--kilo[display the amount of memory in kilobytes]' \ + '(--si)--mega[display the amount of memory in megabytes]' \ + '(--si)--giga[display the amount of memory in gigabytes]' \ + '(--si)--tera[display the amount of memory in terabytes]' \ + '(--si)--peta[display the amount of memory in petabytes]' \ + {-h,--human}'[automatically select unit]' diff --git a/Completion/Linux/Command/_pmap = b/Completion/Linux/Command/_pmap new file mode 100644 index 000000000..ba3321531 --- /dev/null +++ b/Completion/Linux/Command/_pmap @@ -0,0 +1,20 @@ +#compdef pmap +# based on procps-ng-3.3.15 + +_arguments -s \ + '(exit -A --range)'{-A+,--range}'[limit results to the specified = address range]:low,high: ' \ + '(exit -q --quiet)'{-q,--quiet}'[do not display some header or footer = lines]' \ + '(exit -p --show-path)'{-p,--show-path}'[show full path to files in = the mapping column]' \ + '(exit)*: :_pids' \ + + '(format)' \ + '(exit)'{-d,--device}'[show the device format]' \ + '(exit)'{-x,--extended}'[show the extended format]' \ + '(exit)-X[show even more details than -x option]' \ + '(exit)-XX[show everything the kernel provides]' \ + '(exit)'{-c,--read-rc}'[read the default configuration]' \ + '(exit)'{-C+,--read-rc-from=3D}'[read the configuration from the = specified file]: :_files' \ + + '(exit)' \ + '(- *)'{-n,--create-rc}'[create new default configuration and exit]' = \ + '(- *)'{-N+,--create-rc-to=3D}'[create new configuration to the = specified file and exit]: :_files' \ + '(- *)'{-h,--help}'[display help text and exit]' \ + '(- *)'{-V,--version}'[display version information and exit]' diff --git a/Completion/Linux/Command/_slabtop = b/Completion/Linux/Command/_slabtop new file mode 100644 index 000000000..5c8919d12 --- /dev/null +++ b/Completion/Linux/Command/_slabtop @@ -0,0 +1,22 @@ +#compdef slabtop +# based on procps-ng-3.3.15 + +local -a criteria=3D( + 'a:number of active objects' + 'b:objects per slab' + 'c:cache size' + 'l:number of slabs' + 'v:number of active slabs' + 'n:name' + 'o:number of objects' + 'p:page per slab' + 's:object size' + 'u:cache utilization' +) + +_arguments -s \ + '(-d --delay -o --once)'{-d+,--delay=3D}'[specify the delay between = updates]:seconds: ' \ + '(-s --sort)'{-s+,--sort=3D}'[specify the sort = criteria]:criteria:(($criteria))' \ + '(-d --delay -o --once)'{-o,--once}'[display the output once and = exit]' \ + '(-)'{-V,--version}'[display version information and exit]' \ + '(-)'{-h,--help}'[display usage information and exit]' diff --git a/Completion/Linux/Command/_tload = b/Completion/Linux/Command/_tload new file mode 100644 index 000000000..29fddfc3d --- /dev/null +++ b/Completion/Linux/Command/_tload @@ -0,0 +1,9 @@ +#compdef tload +# based on procps-ng-3.3.15 + +_arguments -s \ + '(-s --scale)'{-s+,--scale=3D}'[specify the vertical scale]:number of = characters between tics: ' \ + '(-d --delay)'{-d+,--delay=3D}'[specify the delay between = updates]:seconds: ' \ + '(- *)'{-h,--help}'[display help and exit]' \ + '(- *)'{-V,--version}'[display version information and exit]' \ + '1: :_ttys -o' diff --git a/Completion/Unix/Command/_top b/Completion/Unix/Command/_top index f9d2733fc..4064c408d 100644 --- a/Completion/Unix/Command/_top +++ b/Completion/Unix/Command/_top @@ -8,6 +8,7 @@ opts=3D( -s -w -C ) =20 case $OSTYPE in *linux*) + # based on procps-ng-3.3.15 fields=3D( '%CPU:CPU usage' '%MEM:memory usage (res)' 'CGROUPS:control = groups' 'CODE:code size' 'COMMAND:Command name/line' 'DATA:data + stack = size' @@ -26,25 +27,33 @@ case $OSTYPE in 'nTH:number of threads' 'nsIPC:IPC namespace' 'nsMNT:MNT = namespace' 'nsNET:NET namespace' 'nsPID:PID namespace' 'nsUSER:USER = namespace' 'nsUTS:UTS namespace' 'vMj:major page fault count delta' - 'vMn:minor page fault count delta' + 'vMn:minor page fault count delta' 'LXC:lxc container name' + 'OOMa:out of memory adjustment factor' 'OOMs:out of memory = source' + 'Rsan:resident anonymous memory size' + 'RSfd:resident file-backed memory size' 'RSlk:resident locked = memory size' + 'RSsh:resident shared memory size' 'CGNAME:control group name' + 'NU:last known NUMA node' ) order=3D( '+:descending (default)' '-:ascending' ) + local -a units=3D( 'k:KiB' 'm:MiB' 'g:GiB' 't:TiB' 'p:PiB' 'e:EiB' = ) specs=3D( '(-)-'{h,v}'[show version and usage]' '-b[batch mode]' '-c[command line/program name toggle]' '-d+[delay time interval]:interval' + '-E+[specify the memory scaling unit]: : _describe -V -t units = unit units' '-H[threads mode operation]' '-i[idle process toggle]' '-n+[number of iterations]:number of iterations' '-o+[override sort field]:fieldname:->sortkey' '-O[output field names]' - '*-p+[monitor pids]: :_sequence -s , _pids' + '(-u -U)*-p+[monitor pids]: :_sequence -s , _pids' '-s[secure mode operation]' '-S[cumulative time toggle]' - '(-U)-u+[effective user filter mode]: :_users' - '(-u)-U+[user filter mode]: :_users' + '(-U -p)-u+[effective user filter mode]: :_users' + '(-u -p)-U+[user filter mode]: :_users' '-w+[output width override]::number' + '-1[single/separate cpu states toggle]' );; freebsd*|openbsd*) fields=3D( cpu size res time pri pid ) @@ -63,7 +72,7 @@ case $OSTYPE in '1: :_guard "^-*" "number of processes to display"' );| freebsd*) - fields+=3D( threads total read write fault vcsw ivcsw jid ) + fields+=3D( threads total read write fault vcsw ivcsw jid swap ) specs+=3D( '-C[CPU display mode]' '-a[display command names via argv]' @@ -127,6 +136,8 @@ case $OSTYPE in 'sysmach:total Mach syscalls' 'pageins:total pageins' 'boosts:number of boosts held by the process' + 'instrs:number of instructions retired by the process' + 'cycles:number of cycles spent in the process' ) order=3D( '-:descending (default)' '+:ascending' ) specs=3D( diff --git a/Completion/Unix/Type/_pids b/Completion/Unix/Type/_pids index 8edb33529..d1523fc43 100644 --- a/Completion/Unix/Type/_pids +++ b/Completion/Unix/Type/_pids @@ -1,4 +1,4 @@ -#compdef pflags pcred pmap pldd psig pstack pfiles pwdx pstop prun = pwait +#compdef pflags pcred pldd psig pstack pfiles pwdx pstop prun pwait =20 # If given the `-m ' option, this tries to complete only pids # of processes whose command line match the `'.