Changeset 2061

Show
Ignore:
Timestamp:
10/29/06 02:41:03
Author:
miyagawa
Message:

add --list command

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • misc/blogping

    r2060 r2061  
    1919our $config = eval { YAML::LoadFile($conf) || {} }; 
    2020setup_default() unless $config->{default}; 
     21 
     22if (@ARGV and ($ARGV[0] eq '--list' || $ARGV[0] eq '-l')) { 
     23    my $default = $config->{default}; 
     24    for my $name (keys %$config) { 
     25        next if $name eq 'default'; 
     26        my $site = $config->{$name}; 
     27        $name .= '*' if $name eq $default; 
     28        print $name, " " x (16-length($name)), "$site->{name} ($site->{url})\n"; 
     29    } 
     30    exit; 
     31} 
    2132 
    2233my $name = $ARGV[0] || $config->{default};