From 3118964e8062c9bbb12415a3b1922fdcdccd9742 Mon Sep 17 00:00:00 2001 From: Elijah Perrault Date: Sun, 16 Jan 2011 23:22:34 -0700 Subject: [PATCH] Added a debug mode. --- bin/auto | 12 ++++++++++++ doc/CHANGELOG | 2 ++ 2 files changed, 14 insertions(+) diff --git a/bin/auto b/bin/auto index 63793be..1ff0c15 100755 --- a/bin/auto +++ b/bin/auto @@ -23,6 +23,7 @@ use Parser::Lang; #use Parser::IRC; #use Sys; +# Set version information. use constant { NAME => 'Auto IRC Bot', VER => 3, @@ -31,9 +32,19 @@ use constant { RSTAGE => 'd' }; +# Check for debug mode. +our $DEBUG = 0; +if (defined $ARGV[0]) { + if ($ARGV[0] eq '-d') { + $DEBUG = 1; + } +} + +# Parse configuration file. our $CONF = Parser::Config->new("auto.conf") or print "Failed to open configuration file.\n" and exit; our %SETTINGS = $CONF->parse; +# Parse translations. my @lclv = API::Std::conf_get("locale"); our $LOCALE = $lclv[0][0]; my @lang = split('_', $LOCALE); @@ -41,4 +52,5 @@ Parser::Lang::parse($lang[0]); undef @lang; undef @lclv; +# Expire old logs. API::Log::expire_logs(); diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 48fb3f3..512ffec 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -3,6 +3,8 @@ Auto IRC Bot 3.0: Change Log 3.0 Indev ================================================================== + * Added a debug mode. + * Old logs can now expire if set to do so in config. * Added API function alog() * Added API::Log::expire_logs() * Added API function println()