#
# interface.pl:
-#
# Author:
#
-#use strict;
+# use strict; # TODO
sub whatInterface {
if (!&IsParam("Interface") or $param{'Interface'} =~ /IRC/) {
$who = "local";
$orig{who} = "local";
$ident = $param{'ircNick'};
- $talkchannel = "#CLI";
+ $chan = $talkchannel = "_local";
$addressed = 1;
+ $msgType = 'public';
- print ">>> ";
- while (<STDIN>) {
+ # 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} = $_;
- $_ = &process("local", 'public', $_);
- print ">>> ";
+ $message = $_;
+ chomp $message;
+ last if ($message =~ m/^quit$/);
+ $_ = &process() if $message;
}
+ &doExit();
}
1;