From: Ian Jackson Date: Sun, 14 Feb 2016 23:07:34 +0000 (+0000) Subject: commitid: Provide an internal debugging facility (no callers yet, so nfc) X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=cfc3fd27a3743b7cfe5b73508f65eaf79ab8149a;p=reprap-play.git commitid: Provide an internal debugging facility (no callers yet, so nfc) --- diff --git a/commitid.scad.pl b/commitid.scad.pl index 4c7371f..d646c32 100755 --- a/commitid.scad.pl +++ b/commitid.scad.pl @@ -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() =