Author: dylan
Date: 2004-06-28 00:11:25 -0400 (Mon, 28 Jun 2004)
New Revision: 266

Removed:
   trunk/main/client/lib/Haver/Client/Command/Callback.pm
Modified:
   trunk/main/client/lib/Haver/Client/Command.pm
Log:
Fixed small bug, whereby the default arg parser didn't return anything. :P


Deleted: trunk/main/client/lib/Haver/Client/Command/Callback.pm
===================================================================
--- trunk/main/client/lib/Haver/Client/Command/Callback.pm      2004-06-28 
03:11:01 UTC (rev 265)
+++ trunk/main/client/lib/Haver/Client/Command/Callback.pm      2004-06-28 
04:11:25 UTC (rev 266)
@@ -1,54 +0,0 @@
-# Haver::Client::Command::Callback - register commands as callbacks.
-# 
-# Copyright (C) 2004 Bryan Donlan, Dylan William Hardison.
-# 
-# This module is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This module is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this module; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-package Haver::Client::Command::Callback;
-use strict;
-use warnings;
-
-use Text::ParseWords (); # we use parse_line.
-
-use Haver::Base;
-use base 'Haver::Client::Command';
-
-our $VERSION = 0.01;
-
-sub register {
-       my ($me, $cmd, %opt) = @_;
-       $me->{command}{$cmd} = \%opt;
-}
-
-sub invoke {
-       my ($me, $cmd, @args) = @_;
-       
-       if (exists $me->{command}{$cmd} and exists 
$me->{command}{$cmd}{handler}) {
-               $me->{command}{$cmd}{handler}->(@args);
-       }
-}
-
-sub parse_args {
-       my ($me, $cmd, $arg) = @_;
-       
-       if (exists $me->{command}{$cmd} and exists 
$me->{command}{$cmd}{parser}) {
-               return $me->{command}{$cmd}{parser}->($cmd, $arg);
-       } else {
-               return $me->SUPER::parse_args($cmd, $arg);
-       }
-}
-
-
-
-1;

Modified: trunk/main/client/lib/Haver/Client/Command.pm
===================================================================
--- trunk/main/client/lib/Haver/Client/Command.pm       2004-06-28 03:11:01 UTC 
(rev 265)
+++ trunk/main/client/lib/Haver/Client/Command.pm       2004-06-28 04:11:25 UTC 
(rev 266)
@@ -58,6 +58,8 @@
        
        if (exists $me->{command}{$cmd} and exists 
$me->{command}{$cmd}{parser}) {
                return $me->{command}{$cmd}{parser}->($cmd, $arg);
+       } else {
+               return $arg;
        }
 }
 


Reply via email to