Sha256: ad43a712f5250b3b0c3f24a530bc5fca5dc0475038d1acfbd32cd7f62c80d995

Contents?: true

Size: 753 Bytes

Versions: 1

Compression:

Stored size: 753 Bytes

Contents

#!/usr/bin/ruby

if ARGV.include?('-h') || ARGV.include?('--help') || ARGV.length == 0
  puts 'syntax: [-v] [-l or --list to only list] [-p pid] "command string to match" then some other command to run with its args'
  exit
end

require 'after'
require 'andand' # to avoid warnings

if ARGV[0] == '-v'
  ARGV.shift
  $VERBOSE = true
  puts 'running in verbose mode'
end

if ARGV[0] == '-l' || ARGV[0] == '--list'
  $VERBOSE = true # so it'll output the names...
  ARGV.shift
  After.find_pids(ARGV.shift)
  exit # premature exit
elsif ARGV[0] == '-p'
  ARGV.shift
  pid = ARGV.shift
  After.wait_pid pid.to_i
else
 After.find_and_wait_for(ARGV.shift)
end

puts 'running', ARGV if $VERBOSE
system(*ARGV) if ARGV.length > 0

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
after-0.5.0 bin/after