[Bps-public-commit] r16382 - Prophet/trunk/lib/Prophet/CLI/Command

jesse at bestpractical.com jesse at bestpractical.com
Sun Oct 19 18:42:24 EDT 2008


Author: jesse
Date: Sun Oct 19 18:42:21 2008
New Revision: 16382

Modified:
   Prophet/trunk/lib/Prophet/CLI/Command/Search.pm

Log:
* better display of group-by in search

Modified: Prophet/trunk/lib/Prophet/CLI/Command/Search.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/CLI/Command/Search.pm	(original)
+++ Prophet/trunk/lib/Prophet/CLI/Command/Search.pm	Sun Oct 19 18:42:21 2008
@@ -134,7 +134,8 @@
     my $groups = $self->group_routine->( [$records->items] );
 
     foreach my $group ( @{$groups} ) {
-        if ( $group->{label} ) {
+        $group->{label}  ||= 'none';
+        if ( $#{$groups} &&  $group->{label} ) {
             print "\n"
                 . $group->{label} 
                 . "\n" 
@@ -181,7 +182,7 @@
     my $results = {};
 
     for my $record (@$records) {
-        push @{ $results->{ $record->prop($prop) } }, $record;
+        push @{ $results->{ ( $record->prop($prop) || '') } }, $record;
     }
 
     return [



More information about the Bps-public-commit mailing list