chiark / gitweb /
i18n: i18n-diff-auditor: fix debug
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 30 Sep 2018 20:02:13 +0000 (21:02 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 30 Sep 2018 23:54:38 +0000 (00:54 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
i18n-diff-auditor

index 8fd623a5a67f84036be5a8e5b115bd9d94dc42fe..f40c8e97e7ec0f94685b76c55815df04f248f46f 100755 (executable)
@@ -4,15 +4,14 @@ use Carp;
 use Data::Dumper;
 use Getopt::Long;
 
-open DEBUG, ">/dev/null" or die $!;
-
-GetOptions("debug|D" => sub { open DEBUG, ">&2" or die $!; }
+our $debug = 0;
+GetOptions("debug|D+" => \$debug
           );
 
 our @debug;
 sub debug ($$) {
     my ($i,$s) = @_;
-    push @{ $debug[$i] }, $s;
+    push @{ $debug[$i] }, $s if $debug;
 }
 
 my @d = <>;