ps_f 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/ps_f +11 -7
- metadata +3 -3
data/bin/ps_f
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'optparse'
|
3
|
-
Version =
|
3
|
+
Version = '0.1.6'
|
4
4
|
|
5
5
|
wide = false
|
6
6
|
opt = OptionParser.new
|
@@ -48,12 +48,16 @@ def asm(tree, roots, pre_prefix, cmd_list, basename_only)
|
|
48
48
|
list.sort_by {|a, b| a[0] }.each_with_index do |pid_cmd, i|
|
49
49
|
pid, command = pid_cmd
|
50
50
|
|
51
|
-
if basename_only
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
51
|
+
if basename_only and %r|\A/| =~ command
|
52
|
+
path_list = command.split(' ')
|
53
|
+
rest = []
|
54
|
+
|
55
|
+
until File.exist?(path_list.join(' ')) or path_list.empty?
|
56
|
+
rest << path_list.pop
|
57
|
+
end
|
58
|
+
|
59
|
+
command = File.basename(path_list.join(' '))
|
60
|
+
command << (' ' + rest.join(' ')) unless rest.empty?
|
57
61
|
end
|
58
62
|
|
59
63
|
cmd_list << [pid, pre_prefix + ' \_ ' + command]
|
metadata
CHANGED