From: Baptiste Daroussin <baptiste.daroussin@gmail.com>
To: zsh-workers@zsh.org
Subject: New completion for FreeBSD's fstat and procstat
Date: Tue, 10 Nov 2009 13:25:25 +0100 [thread overview]
Message-ID: <20091110122525.GD54310@wicklow.lan> (raw)
[-- 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'
reply other threads:[~2009-11-10 12:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091110122525.GD54310@wicklow.lan \
--to=baptiste.daroussin@gmail.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).