ps_f 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/README +9 -0
- data/bin/ps_f +3 -4
- metadata +3 -3
data/README
CHANGED
@@ -28,3 +28,12 @@ gem install ps_f
|
|
28
28
|
sugawara 7838 0.0 0.3 908424 54156 ?? S 11:18AM 0:02.44 | | \_ Google Chrome Helper --type=rendere
|
29
29
|
sugawara 4054 0.0 0.4 915828 71916 ?? S 10:02AM 0:05.18 | | \_ Google Chrome Helper --type=rendere
|
30
30
|
...
|
31
|
+
|
32
|
+
shell> ps_f awxfw
|
33
|
+
root 1 0.0 0.0 2512256 2160 ?? Ss 9:05AM 0:17.25 /sbin/launchd
|
34
|
+
sugawara 231 0.0 0.0 2511704 1768 ?? Ss 9:05AM 0:09.00 \_ /sbin/launchd
|
35
|
+
sugawara 672 0.4 1.5 1525224 258792 ?? S 9:07AM 9:53.57 | \_ /Applications/Google Chrome.app/Content...
|
36
|
+
sugawara 21024 0.0 0.5 934164 83508 ?? S 3:26PM 0:12.52 | | \_ /Applications/Google Chrome.app/Conte...
|
37
|
+
sugawara 23500 0.0 0.4 930668 66880 ?? S 4:12PM 0:06.11 | | \_ /Applications/Google Chrome.app/Conte...
|
38
|
+
sugawara 20864 0.0 0.3 909264 52316 ?? S 3:23PM 0:01.29 | | \_ /Applications/Google Chrome.app/Conte...
|
39
|
+
...
|
data/bin/ps_f
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
ps_opts = (ARGV[0] || '').dup
|
3
|
-
wide = false
|
4
3
|
|
5
4
|
if /\A-/ =~ ps_opts
|
6
5
|
system("ps #{ARGV.join(' ')}")
|
@@ -15,7 +14,7 @@ end
|
|
15
14
|
|
16
15
|
ps_opts.gsub!('f', '') if /f/ =~ ps_opts
|
17
16
|
ps_opts << 'u' if (ps_opts.empty? or /u/ !~ ps_opts)
|
18
|
-
wide =
|
17
|
+
wide = ps_opts.scan('w').length
|
19
18
|
|
20
19
|
out = `ps #{ps_opts} -o ppid,command`
|
21
20
|
exit 1 unless $?.success?
|
@@ -86,7 +85,7 @@ def asm(tree, roots, pre_prefix, cmd_list, basename_only)
|
|
86
85
|
end
|
87
86
|
|
88
87
|
cmd_list = []
|
89
|
-
asm(tree, roots, '', cmd_list,
|
88
|
+
asm(tree, roots, '', cmd_list, wide < 2)
|
90
89
|
|
91
90
|
tree_rows = cmd_list.map do |pid, command|
|
92
91
|
row = rows[pid]
|
@@ -122,7 +121,7 @@ end
|
|
122
121
|
|
123
122
|
max_cols = 0
|
124
123
|
|
125
|
-
if
|
124
|
+
if wide < 2 and $stdout.tty?
|
126
125
|
max_cols = `stty size cols 2> /dev/null`.strip.sub(/\A.*\s+/, '').first.to_i
|
127
126
|
end
|
128
127
|
|
metadata
CHANGED