Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

New completion for FreeBSD's fstat and procstat



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
#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))'
#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'


Messages sorted by: Reverse Date, Date, Thread, Author