From: dms Date: Wed, 30 Aug 2000 12:19:23 +0000 (+0000) Subject: preliminary command hook support added X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b0786f18dee5ef1c3b5c0d77606821c8e5cfdffa;p=infobot.git preliminary command hook support added git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@56 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/blootbot/src/CommandStubs.pl b/blootbot/src/CommandStubs.pl index 60b8ec2..1775c08 100644 --- a/blootbot/src/CommandStubs.pl +++ b/blootbot/src/CommandStubs.pl @@ -17,7 +17,8 @@ $W3Search_regex = join '|', @W3Search_engines; # Cmdstats => 'text_label',) #} ### EXAMPLE -# addCmdHook('d?find', \&debianFind(), ( +# addCmdHook('d?find', ( +# CODEREF => \&debianFind(), # Forker => 1, # Identifier => "debian", # Help => "dfind", @@ -26,6 +27,26 @@ $W3Search_regex = join '|', @W3Search_engines; # * viable solution? ### +sub addCmdHook { + my ($ident, %hash) = @_; + + &DEBUG("aCH: added $ident to command hooks."); + $cmdhooks{$ident} = \%hash; +} + +# RUN IF ADDRESSED. +sub parseCmdHook { + foreach (keys %cmdhooks) { + &DEBUG("cmdhooks{$_} => ..."); + my %hash = \%{ $cmdhooks{$_} }; + foreach (keys %hash) { + &DEBUG(" '$_' => '$hash{$_}'."); + } + } + + &DEBUG("pCH: ended."); +} + sub Modules { if (!defined $message) { &WARN("Modules: message is undefined. should never happen.");