lib/after.rb in after-0.8.2 vs lib/after.rb in after-0.8.3
- old
+ new
@@ -56,10 +56,11 @@
else
$VERBOSE = true
end
$DISPLAY_ALL = false
+ # TODO real command line parsing, yikes for this stuff!
if ARGV[0].in? ['-l', '--list']
ARGV.shift
$DISPLAY_ALL = true
query = ARGV.shift || ''
got = After.find_pids(query)
@@ -68,17 +69,17 @@
end
exit # early exit
elsif ARGV[0] == '-p'
ARGV.shift
pids = ARGV.shift
- pids = pids.split(',')
+ pids = pids.split(',')
puts "waiting for pids #{pids.join(',')}" if $VERBOSE and pids.length > 1
- for pid in pids.split(',')
+ for pid in pids
puts "waiting for pid #{pid}" if $VERBOSE
begin
After.wait_pid pid.to_i
rescue Errno::EPERM
- p 'pid does not exist maybe it already had exited ' + pid if $VERBOSE
+ p 'pid does not exist maybe it already has exited ' + pid if $VERBOSE
end
end
else
After.find_and_wait_for(ARGV.shift)
end