File tree 1 file changed +13
-2
lines changed 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ use std::collections::HashMap;
8
8
use std:: iter:: repeat;
9
9
use procrs:: pid:: * ;
10
10
use procrs:: TaskId ;
11
+ use procrs:: meminfo:: MeminfoStatus ;
11
12
use argparse:: { ArgumentParser , StoreTrue , Store } ;
12
13
13
14
fn main ( ) {
@@ -46,15 +47,25 @@ fn main() {
46
47
row ! [ p. stat. pid, p. stat. ppid, name]
47
48
} ,
48
49
( true , false ) => {
49
- name. push_str ( & p. cmdline . join ( " " ) ) ;
50
+ name. push_str (
51
+ match p. cmdline . join ( " " ) {
52
+ ref s if s. len ( ) > 0 => s,
53
+ _ => & p. stat . comm
54
+ }
55
+ ) ;
50
56
row ! [ p. stat. pid, p. stat. ppid, name]
51
57
} ,
52
58
( false , true ) => {
53
59
name. push_str ( & p. stat . comm ) ;
54
60
row ! [ p. stat. pid, p. stat. ppid, name]
55
61
}
56
62
( true , true ) => {
57
- name. push_str ( & p. cmdline . join ( " " ) ) ;
63
+ name. push_str (
64
+ match p. cmdline . join ( " " ) {
65
+ ref s if s. len ( ) > 0 => s,
66
+ _ => & p. stat . comm
67
+ }
68
+ ) ;
58
69
row ! [ p. stat. pid, p. stat. ppid, name]
59
70
}
60
71
}
You can’t perform that action at this time.
0 commit comments