From f5174e6fdf6386a47d610991b449299c9fb392c7 Mon Sep 17 00:00:00 2001 From: stanley lieber Date: Sat, 19 Sep 2015 14:03:22 -0400 Subject: [PATCH] ircrc: add -P option for server password (thanks, nick) --- rc/bin/ircrc | 8 +++++++- sys/man/1/ircrc | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/rc/bin/ircrc b/rc/bin/ircrc index 0a23ca02d..4d65dddf7 100755 --- a/rc/bin/ircrc +++ b/rc/bin/ircrc @@ -10,6 +10,7 @@ netdir=() nick=$user pass=() tls=0 +serverpass=() fn sighup { exit 'hang up' @@ -30,6 +31,8 @@ fn etime { } fn work { + if(~ $#serverpass 1) + echo PASS $serverpass > $netdir/data echo USER $user foo bar :$realname > $netdir/data echo NICK $nick > $netdir/data if (~ $#pass 1) @@ -199,6 +202,9 @@ while (~ $1 -*) { case -p port=$2 shift + case -P + serverpass=$2 + shift case -r realname=$2 shift @@ -208,7 +214,7 @@ while (~ $1 -*) { case -T tls=1 case -* - echo 'usage: ircrc [-p port] [-r realname] [-t target] [-n nick] [-T] [server]' >[1=2] + echo 'usage: ircrc [-p port] [-P server password] [-r realname] [-t target] [-n nick] [-T] [server]' >[1=2] exit 'usage' } shift diff --git a/sys/man/1/ircrc b/sys/man/1/ircrc index 5b2e8554a..eaa8763d7 100644 --- a/sys/man/1/ircrc +++ b/sys/man/1/ircrc @@ -8,6 +8,10 @@ ircrc \- internet relay chat client .I port ] [ +.B -P +.I server password +] +[ .B -r .I realname ] @@ -46,6 +50,9 @@ The options are: Change the default port .RB ( 6667 ). .TP +.BI -P " server password +Specify a password for the remote server. +.TP .BI -r " realname Change the default name .RB ( ).