From 9a050c8dbcf541f2607444870a105c7981cbbd2a Mon Sep 17 00:00:00 2001 From: Bapt Date: Mon, 8 Jun 2009 23:36:05 +0200 Subject: [PATCH] Add fstat completion (complete) removes its entry in todo list Add a comment on _procstat --- .todo | 3 --- _fstat | 15 +++++++++++++++ _procstat | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 _fstat diff --git a/.todo b/.todo index 094900b..2eb7e39 100644 --- a/.todo +++ b/.todo @@ -72,9 +72,6 @@ Currently nothing listed - - Add completion for fstat - Add completion for vmstat diff --git a/_fstat b/_fstat new file mode 100644 index 0000000..0ea1013 --- /dev/null +++ b/_fstat @@ -0,0 +1,15 @@ +#compdef fstat + +local pids +pids=(${${${(f)"$(/usr/bin/procstat -ah)"}/[[:space:]]#/}/[[:space:]]*[[:space:]](ELF32[[: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' diff --git a/_procstat b/_procstat index 6a9b6bb..476daa8 100644 --- a/_procstat +++ b/_procstat @@ -1,7 +1,7 @@ #compdef procstat local pids -#pids=(${${${(f)"$(/usr/bin/procstat -ah)"}/[[:space:]]#/}%%[[:space:]]*}) +#get list of pids and associated process name as comment pids=(${${${(f)"$(/usr/bin/procstat -ah)"}/[[:space:]]#/}/[[:space:]]*[[:space:]](ELF32[[:space:]]|-[[:space:]]#)/:}) _arguments -s \ -- 2.11.4.GIT