Changeset 188

Show
Ignore:
Timestamp:
10/24/08 13:31:08 (3 months ago)
Author:
drarok
Message:

* Added verbossity to list command, showing the latest episode number.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • hellaworld/branches/autonzb/manage.php

    r186 r188  
    2626                ."\tphp manage.php remove <show name> [show name] ...\n" 
    2727                ."OR\n" 
    28                 ."\tphp manage.php list\n" 
     28                ."\tphp manage.php [-v] list\n" 
    2929                ."OR\n" 
    3030                ."\tphp manage.php latest <show name> [episode number]\n" 
     
    6161        // Output the list of feeds we have. 
    6262        case 'list': 
    63                 $feeds = $manager->feeds(); 
     63                $feeds = $manager->feeds(TRUE); 
    6464                $unit = (count($feeds) == 1) ? 'feed' : 'feeds'; 
     65                $maxlen = arr::maxkeylen($feeds); 
     66                $format = $verbose ? "\t%-".$maxlen."s %d\n" : "\t%s\n"; 
    6567                 
    6668                echo sprintf('%d %s:', count($feeds), $unit), "\n"; 
    6769                foreach ($feeds as $feed) 
    68                         echo "\t", $feed, "\n"; 
     70                        printf($format, $feed['name'], $feed['latest_episode']); 
    6971                break; 
    7072