dot

packages and services management
Log | Files | Refs | README

commit 35e876452ca43b1b3e45de16719c2666509eb06a
parent 692d100e3694916aebb50bcde690b1f16cb1cd82
Author: sshbio <jd@ssh.bio>
Date:   Mon,  1 Aug 2016 08:33:09 +0200

irc: improved pager display

Diffstat:
Mbin/.irc.swp | 0
Mbin/irc | 12+++++++-----
2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/bin/.irc.swp b/bin/.irc.swp Binary files differ. diff --git a/bin/irc b/bin/irc @@ -6,7 +6,8 @@ # \/ \/ \____\ - Irc client based on nc and a script from http://xero.nu #=============================================================================== -command_help='/c, /connect, /s, /server SERVER +commands_help=' +/c, /connect, /s, /server SERVER Start connection with SERVER /msg, /privmsg CHANNEL/NICK MESSAGE @@ -86,7 +87,7 @@ input() command="$(printf %s "$command" | tr [a-z] [A-Z])" case "$command" in - MSG ) + M | MSG | PRIVMSG ) write "PRIVMSG $( \ printf '%s' "$argument" | cut -d ' ' -f 1 \ ) :$( \ @@ -97,7 +98,7 @@ input() CHANNEL="$argument" write "JOIN $argument" "$SERVER" ;; - SERVER | CONNECT ) + S | SERVER | C | CONNECT ) if [ "$(ps ax | grep -F "$SERVER")" ] then SERVER="$argument" @@ -199,7 +200,7 @@ output() esac printf "$FORMAT" "$nick" "$command" "$trailing" \ - | tee -a "$IRC_DIR/$SERVER/$channel" + >> "$IRC_DIR/$SERVER/$channel" ;; esac done @@ -218,7 +219,8 @@ output() if [ "$(ps ax | grep -F "$IRC_DIR" | wc -l)" -gt 1 ] then cd "$IRC_DIR" - find . -type f | xargs less -R + for file in $(find . -type f); do files="$files ${file#./}"; done + exec less -R $files else tail -f "$IRC_DIR/in" | input & printf 'This is an interactive interpreter. You can send irc commands.