} else {
arg_error("bad argument `$_'");
}
+ push @{ $cp[$#cp]{Args} }, $_;
}
complete_current_point("completing as it is the final point");
die "$progname: errors in argument(s)\n" if $arg_errors;
my $last;
for ($i=0; $i<@cp; $i++) {
my $this= $cp[$i];
- lprintf("%4s %7s %7s =%5.2f %s %5.02f%%",
+ lprintf("%4s %7s %7s =%5.2f %s %5.02f%% %s",
"#$i",
'+'.($this->{L} - $last_l),
'@'.($this->{L} - $absoffset),
($this->{S} < 0 ? '/' :
$this->{S} > 0 ? '\\' :
'|'),
- $this->{S} * 100);
+ $this->{S} * 100,
+ "@{ $this->{Args} }");
my $next= $cp[$i+1];
if ($interpolate and defined $next) {
my $more_l= 0;
}
parse_args();
-lprintf("args: %s", "@ARGV");
+sub dump_args () {
+ my @oargs;
+ my @ounders;
+ my @opoints;
+ foreach (my $i=0; $i<@cp; $i++) {
+ my $cp= $cp[$i];
+ my @iargs= @{ $cp->{Args} };
+
+ if (@iargs && $iargs[0] =~ m/^\+$numre$/) {
+ my $relmove= shift @iargs;
+ push @oargs, $relmove;
+ my $spc= ' 'x length $relmove;;
+ push @ounders, '-'x length $relmove;;
+ push @opoints, $spc;
+ } elsif ($i) {
+ push @oargs, ' ';
+ push @ounders, '-';
+ push @opoints, ' ';
+ }
+
+ my $ipoint= "#$i";
+ my $lipoint= length $ipoint;
+ my $iargs= "@iargs";
+ my $lip= $lipoint;
+ my $l= $lipoint > length($iargs) ? $lipoint : length($iargs);
+
+ push @oargs, sprintf "%-*s", $l, $iargs;
+ push @ounders, ' 'x $l;
+
+ my $pad= int(($l-$lipoint)/2);
+ push @opoints, (' 'x $pad). $ipoint. (' ' x ($l-$lipoint-$pad));
+ }
+ lprintf("args: %s", join ' ', @oargs);
+ lprintf(" %s", join '|', @ounders);
+ lprintf(" %s", join ' ', @opoints);
+}
+
+dump_args();
lprintf("");
lprintf("control points:");