summaryrefslogtreecommitdiff
path: root/smsbot
diff options
context:
space:
mode:
Diffstat (limited to 'smsbot')
-rwxr-xr-xsmsbot11
1 files changed, 3 insertions, 8 deletions
diff --git a/smsbot b/smsbot
index 6cf5995..f90ebc2 100755
--- a/smsbot
+++ b/smsbot
@@ -31,7 +31,9 @@ my ($opt, $usage) = describe_options(
[ 'help', "print usage message and exit"],
);
-print($usage->text), exit if $opt->help;
+print($usage->text), exit if ($opt->help or @ARGV < 3);
+
+my ($jid, $pw, $inputfile, $room) = @ARGV;
# TODO: support overriding full URL
# TODO: use URI module to construct URL
@@ -60,13 +62,6 @@ sub answer_to {
binmode STDOUT, ":utf8";
-my ($jid, $pw, $inputfile, $room) = @ARGV;
-
-unless (@ARGV >= 3) {
- warn "usage: talkbot <jid> <password> <talkfile> [<conference room jid>]\n";
- exit;
-}
-
read_messages ($inputfile);
my $j = AnyEvent->condvar;