bin/bluepill in kostya-bluepill-0.0.60.2 vs bin/bluepill in kostya-bluepill-0.0.60.3

- old
+ new

@@ -16,10 +16,14 @@ :attempts => 1 } OptionParser.new do |opts| opts.banner = "Usage: bluepill [app] cmd [options]" + opts.on('-l', "--logfile LOGFILE", "Path to logfile, defaults to #{options[:log_file]}") do |file| + options[:log_file] = file + end + opts.on('-c', "--base-dir DIR", "Directory to store bluepill socket and pid files, defaults to #{options[:base_dir]}") do |base_dir| options[:base_dir] = base_dir end opts.on("-v", "--version") do @@ -43,22 +47,23 @@ puts " status\t\t\tLists the status of the proceses for the specified app" puts " start [TARGET]\t\tIssues the start command for the target process or group, defaults to all processes" puts " stop [TARGET]\t\tIssues the stop command for the target process or group, defaults to all processes" puts " restart [TARGET]\t\tIssues the restart command for the target process or group, defaults to all processes" puts " unmonitor [TARGET]\t\tStop monitoring target process or group, defaults to all processes" + puts " log [TARGET]\t\tShow the log for the specified process or group, defaults to all for app" puts " quit\t\t\tStop bluepill" puts puts "See http://github.com/arya/bluepill for README" exit end opts.on_tail('-h','--help', 'Show this message', &help) help.call if ARGV.empty? end.parse! -APPLICATION_COMMANDS = %w(status start stop restart unmonitor quit) +APPLICATION_COMMANDS = %w(status start stop restart unmonitor quit log) -controller = Bluepill::Controller.new(options.slice(:base_dir)) +controller = Bluepill::Controller.new(options.slice(:base_dir, :log_file)) if controller.running_applications.include?(File.basename($0)) && File.symlink?($0) # bluepill was called as a symlink with the name of the target application options[:application] = File.basename($0) elsif controller.running_applications.include?(ARGV.first)