diff options
Diffstat (limited to 'lib/App/Raps2/UI.pm')
-rw-r--r-- | lib/App/Raps2/UI.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/App/Raps2/UI.pm b/lib/App/Raps2/UI.pm index 82b2acd..29e8ef1 100644 --- a/lib/App/Raps2/UI.pm +++ b/lib/App/Raps2/UI.pm @@ -19,6 +19,17 @@ sub new { return bless($ref, $obj); } +sub list { + my ($self, @list) = @_; + my $format = "%-20s %-20s %s\n"; + + if (not $self->{list}->{header}) { + printf($format, map { $_->[0] } @list); + $self->{list}->{header} = 1; + } + printf($format, map { $_->[1] // q{} } @list); +} + sub read_line { my ($self, $str) = @_; |