Skip Menu |

This queue is for tickets about the Term-Sk CPAN distribution.

Report information
The Basics
Id: 57902
Status: resolved
Priority: 0/
Queue: Term-Sk

People
Owner: KEICHNER [...] cpan.org
Requestors: avar [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.05
Fixed in: (no value)



Subject: Support dynamic-width fields
A gripe with Term::Sk's output. The output is formatted like this: format: '%d Elapsed: %8t %21b %4p %2d (%8c of %11m)' output: Elapsed: 00:00:00 ########_____________ 40% \\ ( 1_971 of 4_943) It would be really nice if %c and %m supported dynamic growth. Now they just occupy exactly one character, and will wrap when their values go past 9.
RT-Send-CC: avar [...] cpan.org, klaus03 [...] gmail.com
Le Jeu 27 Mai 2010 08:34:31, AVAR a écrit : Show quoted text
> A gripe with Term::Sk's output. The output is formatted like this: > > format: '%d Elapsed: %8t %21b %4p %2d (%8c of %11m)' > output: Elapsed: 00:00:00 ########_____________ 40% \\ ( 1_971 > of > 4_943) > > It would be really nice if %c and %m supported dynamic growth. Now > they > just occupy exactly one character, and will wrap when their values go > past 9.
Thanks for your message. I will fix the wrapping by allowing dynamic growth. I think I will find some time next week to change the module. -- Klaus
RT-Send-CC: klaus03 [...] gmail.com
Le Jeu 27 Mai 2010 09:36:10, KEICHNER a écrit : Show quoted text
> Le Jeu 27 Mai 2010 08:34:31, AVAR a écrit :
> > A gripe with Term::Sk's output. The output is formatted like this: > > > > format: '%d Elapsed: %8t %21b %4p %2d (%8c of %11m)' > > output: Elapsed: 00:00:00 ########_____________ 40% \\ ( 1_971 > > of > > 4_943) > > > > It would be really nice if %c and %m supported dynamic growth. Now > > they > > just occupy exactly one character, and will wrap when their values go > > past 9.
> > Thanks for your message. > I will fix the wrapping by allowing dynamic growth. > > I think I will find some time next week to change the module. > > -- > Klaus
I have released Term::Sk ver 0.06 Here is a showcase: use strict; use warnings; use Term::Sk; { print qq|Term::Sk->new('num %c of %m', { test => 1, base => 1234567, target => 2345678, num => q{9,999} } );\n|; my $ctr = Term::Sk->new('num %c of %m', { test => 1, base => 1234567, target => 2345678, num => q{9,999} } ); print "Result: ", content($ctr->get_line), "\n\n"; } sub content { my ($text) = @_; $text =~ s{^ \010+ \s+ \010+}{}xms; return $text; } ***************************************************** And this is the output: ***************************************************** Term::Sk->new('num %c of %m', { test => 1, base => 1234567, target => 2345678, num => q{9,999} } ); Result: num 1,234,567 of 2,345,678 ***************************************************** If you agree, I will close this ticket. -- Klaus
On Sat May 29 13:15:13 2010, KEICHNER wrote: Show quoted text
> If you agree, I will close this ticket.
Thanks for implementing this. I've tested it and it works exactly as expected.