zsh-workers
 help / color / mirror / code / Atom feed
* New completion for FreeBSD's fstat and procstat
@ 2009-11-10 12:25 Baptiste Daroussin
  0 siblings, 0 replies; only message in thread
From: Baptiste Daroussin @ 2009-11-10 12:25 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 143 bytes --]

Hi

Please forget my previous mail has there is a bug in _procstat
so here are New Completion for FreeBSD's procstat and fstat

regards, 
Bapt

[-- Attachment #2: _procstat --]
[-- Type: text/plain, Size: 707 bytes --]

#compdef procstat

local pids
#get list of pids and associated process name as comment
pids=(${${${(f)"$(/usr/bin/procstat -ah)"}/[[:space:]]#/}/[[:space:]]*[[:space:]](ELF[[:digit:]]#[[:space:]]|-[[:space:]]#)/:})

_arguments -s \
'-b[Display binary information for the process]' \
'-c[Display command line arguments for the process]' \
'-f[Display file descriptor information for the process]' \
'-k[Display the stacks of kernel threads in the process]' \
'-s[Display security credential information for the process]' \
'-t[Display thread information for the process]' \
'-v[Display virtual memory mappings for the process]' \
'-h[Suppress table headers.]' \
'-a[All processes]' \
':Process id:(($pids))'

[-- Attachment #3: _fstat --]
[-- Type: text/plain, Size: 675 bytes --]

#compdef fstat

local pids
pids=(${${${(f)"$(/usr/bin/procstat -ah)"}/[[:space:]]#/}/[[:space:]]*[[:space:]](ELF[[:digit:]]#[[:space:]]|-[[:space:]]#)/:})

_arguments -s \
'-f[Restrict examination to files open in the same file systems as the named file arguments]' \
'-M[Extract values associated with the name list from the specified core]:core:_files' \
'-N[Extract the name list from the specified system]:system:' \
'-m[Include memory-mapped files in the listing]' \
'-n[Numerical format]' \
'-p[Report all files open by the specified process]:Process id:(($pids))' \
'-u[Report all files open by the specified user]:User:_users' \
'-v[Verbose mode]' \
'*:Files:_files'

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-11-10 12:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-10 12:25 New completion for FreeBSD's fstat and procstat Baptiste Daroussin

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).