chiark / gitweb /
commitid: Provide an internal debugging facility (no callers yet, so nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 14 Feb 2016 23:07:34 +0000 (23:07 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 14 Feb 2016 23:07:34 +0000 (23:07 +0000)
commitid.scad.pl

index 4c7371fb5ba19d3b4b711d8ddf851452b6d656b5..d646c32762bfca62f3ce9fe61f57a0d53f986701 100755 (executable)
@@ -261,8 +261,17 @@ use strict;
 
 $SIG{__WARN__} = sub { die @_; };
 
+our $debug=0;
+
+if (@ARGV && $ARGV[0] =~ m/^-(D+)$/) {
+    $debug = length $1;
+    shift @ARGV;
+}
+
 sub p { print @_ or die $!; }
 
+sub p_debug { print STDERR @_ if $debug; }
+
 p <<'END';
 // *** AUTOGENERATED - DO NOT EDIT *** //
 function Commitid_pixelsz() =