X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2FCLI%2FSupport.pl;fp=src%2FCLI%2FSupport.pl;h=6b2de5b1e972dbdba5a92ce13620b7423f36e4a4;hb=f88ca7fad37e0d6224b3e31fe3b54cde81c68ac0;hp=42df6df6749a5c6cc504bd3ff788d4a1eac77b1e;hpb=c01e63ad0eed546c196fac71d96411baf1d22282;p=infobot.git diff --git a/src/CLI/Support.pl b/src/CLI/Support.pl index 42df6df..6b2de5b 100644 --- a/src/CLI/Support.pl +++ b/src/CLI/Support.pl @@ -5,6 +5,34 @@ # Created: 20021028 # +sub cliloop { + &status("Using CLI..."); + &status("Now type what you want."); + + $nuh = "local!local\@local"; + $uh = "local\@local"; + $who = "local"; + $orig{who} = "local"; + $ident = $param{'ircNick'}; + $chan = $talkchannel = "_local"; + $addressed = 1; + $msgType = 'public'; + + # install libterm-readline-gnu-perl to get history support + use Term::ReadLine; + $term = new Term::ReadLine 'blootbot'; + $prompt = "$who> "; + #$OUT = $term->OUT || STDOUT; + while ( defined ($_ = $term->readline($prompt)) ) { + $orig{message} = $_; + $message = $_; + chomp $message; + last if ($message =~ m/^quit$/); + $_ = &process() if $message; + } + &doExit(); +} + sub msg { my ($nick, $msg) = @_; if (!defined $nick) {