From 4ecc4f780ca32a7641329121d13e8bf353154358 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Tue, 18 Sep 2007 20:36:59 +0000 Subject: Flags are now displayed as part of show. --- perl/Wallet/Object/Base.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'perl/Wallet') diff --git a/perl/Wallet/Object/Base.pm b/perl/Wallet/Object/Base.pm index 1075c13..8d01ae8 100644 --- a/perl/Wallet/Object/Base.pm +++ b/perl/Wallet/Object/Base.pm @@ -467,7 +467,19 @@ sub show { } my $output = ''; my @acls; + + # Format the results. We use a hack to insert the flags before the first + # trace field since they're not a field in the object in their own right. for (my $i = 0; $i < @data; $i++) { + if ($attrs[$i][0] eq 'ob_created_by') { + my @flags = $self->flag_list; + if (@flags == 1 and not defined $flags[0]) { + return undef; + } + if (@flags) { + $output .= sprintf ("%15s: %s\n", 'Flags', "@flags"); + } + } next unless defined $data[$i]; if ($attrs[$i][0] =~ /^ob_(owner|acl_)/) { my $acl = eval { Wallet::ACL->new ($data[$i], $self->{dbh}) }; -- cgit v1.2.3