tools.ps: sort-by-pid and print headers.

db4
John Benediktsson 2013-04-25 10:05:57 -07:00
parent 46f306132c
commit ae3e48e156
2 changed files with 4 additions and 5 deletions

View File

@ -3,7 +3,7 @@
USING: accessors alien.c-types alien.data alien.syntax arrays
assocs byte-arrays classes.struct continuations fry grouping
kernel literals math sequences sorting splitting strings system
kernel literals math sequences splitting strings system
system-info.macosx tools.ps unix unix.time unix.types ;
QUALIFIED-WITH: alien.c-types c
@ -151,5 +151,4 @@ PRIVATE>
M: macosx ps ( -- assoc )
procs [ kp_proc>> p_pid>> 0 > ] filter
[ kp_proc>> [ p_pid>> ] [ ps-arg ] bi ] { } map>assoc
sort-keys ;
[ kp_proc>> [ p_pid>> ] [ ps-arg ] bi ] { } map>assoc ;

View File

@ -1,6 +1,6 @@
! Copyright (C) 2012-2013 Doug Coleman, John Benediktsson.
! See http://factorcode.org/license.txt for BSD license.
USING: combinators prettyprint system vocabs ;
USING: combinators prettyprint sequences sorting system vocabs ;
IN: tools.ps
HOOK: ps os ( -- assoc )
@ -12,4 +12,4 @@ HOOK: ps os ( -- assoc )
} cond require
: ps. ( -- )
ps simple-table. ;
ps sort-keys { "PID" "CMD" } prefix simple-table. ;