summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-07-11 22:33:33 -0500
committerJesse Luehrs <doy@tozt.net>2009-07-11 22:33:33 -0500
commit232c315b142ce93e85a8175e3828f026691aa57b (patch)
tree68bbe1b50afe880f1a46198b545e1c03c171cebf
parent9e612346632a750baabbf639e4e6a449e5206027 (diff)
downloadapp-termcast-232c315b142ce93e85a8175e3828f026691aa57b.tar.gz
app-termcast-232c315b142ce93e85a8175e3828f026691aa57b.zip
add an option for making watchers cause a bell
-rw-r--r--lib/App/Termcast.pm14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/App/Termcast.pm b/lib/App/Termcast.pm
index 99c90a3..bdef01b 100644
--- a/lib/App/Termcast.pm
+++ b/lib/App/Termcast.pm
@@ -3,7 +3,7 @@ use Moose;
use IO::Pty::Easy;
use IO::Socket::INET;
use Term::ReadKey;
-with 'MooseX::Getopt';
+with 'MooseX::Getopt::Dashes';
=head1 NAME
@@ -47,6 +47,13 @@ has password => (
isa => 'Str',
default => 'asdf', # really unimportant
documentation => 'Password for the termcast server (mostly unimportant)',
+
+has bell_on_watcher => (
+ is => 'rw',
+ isa => 'Bool',
+ default => 0,
+ documentation => "Send a terminal bell when a watcher connects\n"
+ . " or disconnects",
);
sub run {
@@ -95,7 +102,10 @@ sub run {
warn "Error reading from socket: $!" unless defined $buf;
last;
}
- # XXX: do something with this? (watcher notification, etc)
+ if ($self->bell_on_watcher) {
+ # something better to do here?
+ syswrite STDOUT, "\a";
+ }
}
}
ReadMode 0;