our @forms;
-sub rjustt ($$;$) { # right justify and truncate (ie, pad and truncate at left)
- # always includes prefix
- my ($sz, $whole, $prefix) = @_;
+sub rjustt ($$$;$) {
+ # right justify and truncate (ie, pad and truncate at left)
+ # always includes prefix
+ my ($sz, $what, $whole, $prefix) = @_;
$prefix //= '';
my $lw = length $whole;
my $spare = $sz - $lw - (length $prefix);
substr($whole, ($spare < 0 ? -$spare : 0));
}
-sub ljustt ($$;$) {
- my ($sz, $whole, $suffix) = @_;
+sub ljustt ($$$;$) {
+ my ($sz, $what, $whole, $suffix) = @_;
$suffix //= '';
$sz -= length $suffix;
return sprintf "%-${sz}.${sz}s%s", $whole, $suffix;
gentextmodule_demo_start_batch();
if (defined($git_count)) {
- my $smallstr = rjustt($sz, $git_count, $git_dirty);
+ my $smallstr = rjustt($sz, 'Count', $git_count, $git_dirty);
my $forgitobj = $sz - length($git_count) - 1;
if (defined($git_object) && $forgitobj >= 2) {
- $smallstr = ljustt($forgitobj, $git_object).
+ $smallstr = ljustt($forgitobj, 'Objid', $git_object).
($git_dirty || ' ').
$git_count;
}
genform_plusq("Small$sz", $smallstr);
}
- genform_plusq("Git$sz", ljustt($sz, $git_object, $git_dirty))
+ genform_plusq("Git$sz", ljustt($sz, 'Objid', $git_object, $git_dirty))
if defined $git_object;
if (defined $git_count && defined $git_object) {
genform("Full".($sz*2),
- ljustt($sz, $git_object),
- rjustt($sz, $git_count, $git_dirty));
+ ljustt($sz, 'Objid', $git_object),
+ rjustt($sz, 'Count', $git_count, $git_dirty));
my $e = $sz;
genform("Full".($e*3)."T",
- ljustt($e*2, $git_object, $git_dirty)
+ ljustt($e*2, 'Objid', $git_object, $git_dirty)
=~ m/.{$e}/g,
- rjustt($e, $git_count));
+ rjustt($e, 'Count', $git_count));
}
}
}