Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
New completion for FreeBSD's fstat and procstat
- X-seq: zsh-workers 27381
- From: Baptiste Daroussin <baptiste.daroussin@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: New completion for FreeBSD's fstat and procstat
- Date: Tue, 10 Nov 2009 13:25:25 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:date:from:to:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=/cg+hFHYJp6k99tRT44MHPIEHwpEIKWRgInRArE7Gys=; b=CBO9qClmhNbFOLus6/WNyXa+z9vDJiUXMcMO7MsoLStH+x6FRjgjQ/CzJIgkwzwXbT DYFm7jLt0tgFQyOLk2B6EfRwNhU6IvqrX9mQ3Fc2sMxMwopGIusgHKfvuZvecyi5QSaM QrKmWc91Yp/nB9mcQNnGRcp03bf2LsS3qw/fk=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=s2aB3VCb5+QtZT3/IILOsUsz4GzU00/2fx0qnwQ1WpBYA1XaVzVh+rx/iSZTQELwHp /oP29uHaezx2Yns2W5C400QYymfeyJS/x65VJYxHIUyep1pKGFnkWIjiIRmSf3eFfim5 b0GntvXOkhPr9a1qEATQDzb3KA22iIsluGaX0=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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