diff options
| author | Trevor Slocum | 2016-04-26 11:41:22 -0700 | 
|---|---|---|
| committer | Trevor Slocum | 2016-04-26 11:41:22 -0700 | 
| commit | 538b2c13f460213b61baa5190b88aa5eff7765e8 (patch) | |
| tree | 4b35b4ea899fa52e4a5af835479751f7a1109c6a | |
| parent | fa39bc3a92fd2a8b7efdcbb7ae326e3227a9e4f3 (diff) | |
| download | scripts.irssi.org-538b2c13f460213b61baa5190b88aa5eff7765e8.tar.bz2 | |
Trim whitespace from hilighted text and improve script usage examples
| -rw-r--r-- | scripts/hilightcmd.pl | 9 | 
1 files changed, 6 insertions, 3 deletions
| diff --git a/scripts/hilightcmd.pl b/scripts/hilightcmd.pl index c2c8295..42585ef 100644 --- a/scripts/hilightcmd.pl +++ b/scripts/hilightcmd.pl @@ -3,8 +3,11 @@  # Originally based on hilightwin.pl work and djcraven5's idea for making remote  # computer beep through ssh.  # -# Example of use, assuming you got a ssh and beep on your remote: -# /set hilightcmd_systemcmd ssh user@host beep & +# Example of use, assuming you have ssh and beep on your remote: +#   /set hilightcmd_systemcmd ssh user@host beep & +# +# The hilighted text may be passed as a quoted string: +#   /set hilightcmd_systemcmd printf "%s\n" %(message)s >> ~/hilights  #  use strict; @@ -36,7 +39,7 @@ Irssi::signal_add('print text' => sub {  	&& (Irssi::active_win()->{refnum} != $dest->{window}->{refnum}              || Irssi::settings_get_bool('hilightcmd_currentwin'))) { -        $stripped =~ s/"/\\"/g; +        $stripped =~ s/^\s+|\s+$//g;          system(named_sprintf(              Irssi::settings_get_str('hilightcmd_systemcmd'),              message => shell_quote_best_effort $stripped | 
