Method: TTY::Command::Printers::Pretty#print_command_exit

Defined in:
lib/tty/command/printers/pretty.rb


30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/tty/command/printers/pretty.rb', line 30

def print_command_exit(cmd, status, runtime, *args)
  if cmd.only_output_on_error && !status.zero?
    output << out_data
    output << err_data
  end

  runtime = TIME_FORMAT % [runtime, pluralize(runtime, "second")]
  message = ["Finished in #{runtime}"]
  message << " with exit status #{status}" if status
  message << " (#{success_or_failure(status)})"
  write(cmd, message.join)
end