ircrc: add -P option for server password (thanks, nick)

This commit is contained in:
stanley lieber 2015-09-19 14:03:22 -04:00
parent a90662c2e6
commit f5174e6fdf
2 changed files with 14 additions and 1 deletions

View file

@ -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

View file

@ -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 ( <nil> ).