Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
Colors in headers
Browse files Browse the repository at this point in the history
  • Loading branch information
porras committed Mar 16, 2015
1 parent 910720c commit f4a3b5f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/command.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require "http/client"
require "colorize"

module Crul
class Command
Expand All @@ -25,9 +26,12 @@ module Crul
end

private def print_response(response)
@output.puts "#{response.version} #{response.status_code} #{response.status_message}"
with_color.light_blue.surround { @output << response.version }
with_color.cyan.surround { @output << " #{response.status_code} " }
with_color.yellow.surround { @output.puts response.status_message }
response.headers.each do |name, value|
@output.puts "#{name}: #{value}"
@output << "#{name}: "
with_color.cyan.surround { @output.puts value }
end
@output.puts
@options.formatter.new(@output, response).print
Expand Down

0 comments on commit f4a3b5f

Please sign in to comment.