From 7ab596b097406008d88bdd3530398d23b22d1eab Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 12 Feb 2016 01:45:56 +0000 Subject: [PATCH] commitid.scad.pl: introduce genform_prep to reset form generator info (nfc) --- commitid.scad.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/commitid.scad.pl b/commitid.scad.pl index 8bd4aa7..7245373 100755 --- a/commitid.scad.pl +++ b/commitid.scad.pl @@ -449,6 +449,9 @@ sub ljustt ($$$;$) { return sprintf "%-${sz}.${sz}s%s", $whole, $suffix; } +sub genform_prep() { +} + sub genform ($@) { my ($form, @lines) = @_; gentextmodule($form, @lines); @@ -538,6 +541,7 @@ sub do_git () { gentextmodule_demo_start_batch(); if (defined($git_count)) { + genform_prep(); my $smallstr = rjustt($sz, 'Count', $git_count, $git_dirty); my $forgitobj = $sz - length($git_count) - 1; if (defined($git_object) && $forgitobj >= 2) { @@ -548,14 +552,17 @@ sub do_git () { genform_plusq("Small$sz", $smallstr); } + genform_prep(); genform_plusq("Git$sz", ljustt($sz, 'Objid', $git_object, $git_dirty)) if defined $git_object; if (defined $git_count && defined $git_object) { + genform_prep(); genform("Full".($sz*2), ljustt($sz, 'Objid', $git_object), rjustt($sz, 'Count', $git_count, $git_dirty)); + genform_prep(); my $e = $sz; genform("Full".($e*3)."T", ljustt($e*2, 'Objid', $git_object, $git_dirty) -- 2.30.2