From a2f0207fe964b44fbc4399d4153456fd8e2d5c9d Mon Sep 17 00:00:00 2001 From: timriker Date: Mon, 28 Feb 2005 03:38:26 +0000 Subject: [PATCH] postprocess for CLI git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@1189 c11ca15a-4712-0410-83d8-924469b57eb5 --- blootbot/src/CLI/Support.pl | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/blootbot/src/CLI/Support.pl b/blootbot/src/CLI/Support.pl index 26a7416..c6fe276 100644 --- a/blootbot/src/CLI/Support.pl +++ b/blootbot/src/CLI/Support.pl @@ -4,6 +4,9 @@ # Version: v0.1 (20021028) # Created: 20021028 # +use strict; + +my $postprocess; sub cliloop { &status("Using CLI..."); @@ -21,8 +24,8 @@ sub cliloop { # install libterm-readline-gnu-perl to get history support use Term::ReadLine; - $term = new Term::ReadLine 'blootbot'; - $prompt = "$who> "; + my $term = new Term::ReadLine 'blootbot'; + my $prompt = "$who> "; #$OUT = $term->OUT || STDOUT; while ( defined ($_ = $term->readline($prompt)) ) { $orig{message} = $_; @@ -47,6 +50,16 @@ sub msg { return; } + if ( $postprocess ) { + undef $postprocess; + } elsif ($postprocess = &getChanConf('postprocess', $talkchannel)) { + &DEBUG("say: $postprocess $msg"); + &parseCmdHook("main", $postprocess . ' ' . $msg); + &parseCmdHook("extra", $postprocess . ' ' . $msg); + undef $postprocess; + return; + } + &status(">$nick< $msg"); print("$nick: $msg\n"); -- 2.39.5