# -*- mode: perl; coding: utf-8 -*-
# Keitairc::Config
-# $Id: Config.pm,v 1.18 2008-08-02 15:02:15 morimoto Exp $
+# $Id: Config.pm,v 1.19 2008-08-02 17:54:03 morimoto Exp $
# $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/Keitairc/Config.pm,v $
#
# Copyright (c) 2008 Jun Morimoto <morimoto@mrmt.net>
$me->debug(0);
if(defined $argv[0]){
- unless(-r $argv[0]){
- Keitairc::Log::log("Can't read $argv[0]");
- exit 1;
+ if(-r $argv[0]){
+ $me->file($argv[0]);
+ shift(@argv);
}
- $me->file($argv[0]);
- shift(@argv);
}else{
$me->file('/etc/keitairc');
$me->file($ENV{HOME} . '/.keitairc');
Keitairc::Log::log('au_pcsv has obsoleted from keitairc 2.0');
}
- unless(length $me->irc_nick()){
+ if(!defined($me->irc_nick()) || !length($me->irc_nick())){
Keitairc::Log::log_die('irc_nick does not specified');
}
- unless(length $me->irc_username()){
+ if(!defined($me->irc_username()) || !length($me->irc_username())){
Keitairc::Log::log_die('irc_username does not specified');
}
- unless(length $me->irc_server()){
+ if(!defined($me->irc_server()) || !length($me->irc_server())){
Keitairc::Log::log_die('irc_server does not specified');
}
- unless(length $me->web_port()){
+ if(!defined($me->web_port()) || !length($me->web_port())){
Keitairc::Log::log_die('web_port does not specified');
}
- unless(length $me->web_host()){
+ if(!defined($me->web_host()) || !length($me->web_host())){
Keitairc::Log::log_die('web_host does not specified');
}
- unless(length $me->web_password()){
+ if(!defined($me->web_password()) || !length($me->web_password())){
Keitairc::Log::log_die('web_password does not specified');
}