chiark
/
gitweb
/
~ianmdlvl
/
reprap-play.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bd86cff
)
commitid.scad.pl: Introduce genform() (nfc)
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Fri, 5 Feb 2016 19:59:17 +0000
(19:59 +0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Fri, 5 Feb 2016 19:59:17 +0000
(19:59 +0000)
commitid.scad.pl
patch
|
blob
|
history
diff --git
a/commitid.scad.pl
b/commitid.scad.pl
index 6838365d9b2999404f988ba187240d9b3cf2ae50..3c409f5416925e1ba548eaf9f2ba824f5588e991 100755
(executable)
--- a/
commitid.scad.pl
+++ b/
commitid.scad.pl
@@
-267,7
+267,12
@@
sub ljustt ($$;$) {
return sprintf "%-${sz}.${sz}s%s", $whole, $suffix;
}
return sprintf "%-${sz}.${sz}s%s", $whole, $suffix;
}
-sub gentextmodule_q ($$$) {
+sub genform ($@) {
+ my ($form, @lines) = @_;
+ gentextmodule($form, @lines);
+}
+
+sub genform_q ($$$) {
my ($form, $s, $lines) = @_;
$gtm_demo_j++;
my $l = length $s;
my ($form, $s, $lines) = @_;
$gtm_demo_j++;
my $l = length $s;
@@
-275,14
+280,14
@@
sub gentextmodule_q ($$$) {
my $e = $l/$lines;
return if $e < 2;
$gtm_demo_j--;
my $e = $l/$lines;
return if $e < 2;
$gtm_demo_j--;
- gen
textmodule
($form, $s =~ m/.{$e}/g);
+ gen
form
($form, $s =~ m/.{$e}/g);
}
}
-sub gen
textmodule
_plusq ($$) {
+sub gen
form
_plusq ($$) {
my ($form, $s) = @_;
my ($form, $s) = @_;
- gen
textmodule
($form, $s);
- gen
textmodule
_q("${form}S", $s, 2);
- gen
textmodule
_q("${form}T", $s, 3);
+ gen
form
($form, $s);
+ gen
form
_q("${form}S", $s, 2);
+ gen
form
_q("${form}T", $s, 3);
}
our @gcmd;
}
our @gcmd;
@@
-341,22
+346,22
@@
sub do_git () {
foreach my $sz (2..10) {
gentextmodule_demo_start_batch();
foreach my $sz (2..10) {
gentextmodule_demo_start_batch();
- gen
textmodule
_plusq("Small$sz", rjustt($sz, $git_count, $git_dirty))
+ gen
form
_plusq("Small$sz", rjustt($sz, $git_count, $git_dirty))
if defined $git_count;
if defined $git_count;
- gen
textmodule
_plusq("Git$sz", ljustt($sz, $git_object, $git_dirty))
+ gen
form
_plusq("Git$sz", ljustt($sz, $git_object, $git_dirty))
if defined $git_object;
if (defined $git_count && defined $git_object) {
if defined $git_object;
if (defined $git_count && defined $git_object) {
- gen
textmodule
("Full".($sz*2),
-
ljustt($sz, $git_object),
-
rjustt($sz, $git_count, $git_dirty));
+ gen
form
("Full".($sz*2),
+ ljustt($sz, $git_object),
+ rjustt($sz, $git_count, $git_dirty));
my $e = $sz;
my $e = $sz;
- gen
textmodule
("Full".($e*3)."T",
-
ljustt($e*2, $git_object, $git_dirty)
-
=~ m/.{$e}/g,
-
rjustt($e, $git_count));
+ gen
form
("Full".($e*3)."T",
+ ljustt($e*2, $git_object, $git_dirty)
+ =~ m/.{$e}/g,
+ rjustt($e, $git_count));
}
}
}
}
}
}