Permalink
Browse files

Allow forcing colour on with --colour, even if STDOUT is not a terminal

  • Loading branch information...
hoytech committed Mar 24, 2013
1 parent 3be287b commit c1f7c7a8886547acf82e28d9ca57dd3a0f3e5e9f
Showing with 5 additions and 4 deletions.
  1. +5 −4 bin/log-defer-viz
View
@@ -62,7 +62,6 @@ my $opt = {
'verbosity' => 30,
'quiet' => 0,
'verbose' => 0,
- 'colour' => 1,
'timers' => 1,
'timer-columns' => 100,
@@ -84,9 +83,11 @@ if ($opt->{help}) {
die "Only json input-format is currently supported" unless $opt->{'input-format'} eq 'json';
-$opt->{colour} = $opt->{color} if defined $opt->{color};
-delete $opt->{colour} if !-t STDOUT;
-
+$opt->{colour} = $opt->{color} if exists $opt->{color};
+if (!exists $opt->{colour}) {
+ $opt->{colour} = 1 if -t STDOUT;
+}
+
if ($opt->{verbose} && $opt->{quiet}) {
die "--verbose and --quiet are incompatible";
} elsif ($opt->{verbose}) {

0 comments on commit c1f7c7a

Please sign in to comment.