def load_command
file = @args[1]
action = @args[2] || 'leave'
unless ['stop', 'remove', 'leave', ''].include?(action)
puts "Command '#{@command}' action must be either 'stop', 'remove' or 'leave'"
exit(1)
end
puts "Sending '#{@command}' command with action '#{action}'"
puts
unless File.exist?(file)
abort "File not found: #{file}"
end
affected, errors, removed = *@server.running_load(File.read(file), File.expand_path(file), action)
unless affected.empty?
puts 'The following tasks were affected:'
affected.each do |w|
puts ' ' + w
end
end
unless removed.empty?
puts 'The following tasks were removed:'
removed.each do |w|
puts ' ' + w
end
end
unless errors.empty?
puts errors
exit(1)
end
end