aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile6
-rw-r--r--kirc.177
-rw-r--r--kirc.c34
3 files changed, 101 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index 3b0fb68..88e0f8d 100644
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,7 @@
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
+MANPREFIX = $(PREFIX)/share/man
all: kirc
@@ -13,11 +14,16 @@ kirc: kirc.o Makefile
install: all
mkdir -p $(DESTDIR)$(BINDIR)
+ mkdir -p $(DESTDIR)$(MANPREFIX)/man1
cp -f kirc $(DESTDIR)$(BINDIR)
chmod 755 $(DESTDIR)$(BINDIR)/kirc
+ version=$$(sed -n '/#define VERSION/{s/^[^"]*"//;s/".*//;p;q}' kirc.c); \
+ sed "s/VERSION/$$version/g" kirc.1 > $(DESTDIR)$(MANPREFIX)/man1/kirc.1
+ chmod 644 $(DESTDIR)$(MANPREFIX)/man1/kirc.1
uninstall:
rm -f $(DESTDIR)$(BINDIR)/kirc
+ rm -f $(DESTDIR)$(MANPREFIX)/man1/kirc.1
clean:
rm -f kirc *.o
diff --git a/kirc.1 b/kirc.1
new file mode 100644
index 0000000..48e4fe8
--- /dev/null
+++ b/kirc.1
@@ -0,0 +1,77 @@
+.TH KIRC 1 kirc\-VERSION
+.SH NAME
+kirc \- KISS for IRC
+.SH SYNOPSIS
+.B kirc
+.RB [ \-s
+.IR server ]
+.RB [ \-p
+.IR port ]
+.RB [ \-n
+.IR nick ]
+.RB [ \-c
+.IR chan ]
+.RB ...
+.SH DESCRIPTION
+.B kirc
+is an extremely fast and simple IRC client designed with portability in mind.
+This client reads from stdin and prints to stdout, so all traffic can
+multiplexed and text parsed or modified using external commands. All highlighted
+text and color can be controlled with ANSI escape sequences.
+.SH OPTIONS
+.TP
+.BI \-s " server"
+Overrides the default host (irc.freenode.org)
+.TP
+.BI \-p " port"
+Overrides the default port (6697)
+.TP
+.BI \-c " chan"
+Specifies the channel(s) to JOIN (delimited by "," or "|")
+.TP
+.BI \-n " nick"
+Specifies the NICK connection nickname
+.TP
+.BI \-u " real"
+Specifies the users real name
+.TP
+.BI \-u " user"
+Specifies the USER connection username
+.TP
+.BI \-k " pass"
+Specifies the PASS connection password
+.TP
+.BI \-w " nick_width"
+Specifies max character width printed in the left column
+.TP
+.BI \-W " max_width"
+Specifies max printed with of the IRC stream
+.TP
+.BI \-a " auth"
+Specifies SASL PLAIN authentication token
+.TP
+.BI \-e
+Specifies SASL EXTERNAL
+.TP
+.BI \-v
+Prints the version information to stderr, then exits
+.SH COMMANDS
+.TP
+.BI /<command>
+Send message to IRC host (e.g. /JOIN, /PART, /WHOIS, etc.)
+.TP
+.BI /?
+Print current default message channel
+.TP
+.BI /#<channel>
+Set default message channel to <channel>
+.TP
+.BI <message>
+Send PRIVMSG to default message channel with <message> as the content
+.TP
+.BI /@<channel|nick>
+Send PRIVMSG to specified <channel> or <nick>
+.SH AUTHOR
+Michael Czigler <michaelczigler at icloud dot com>
+.SH BUGS
+Please report them!
diff --git a/kirc.c b/kirc.c
index b51c971..ebcc1ca 100644
--- a/kirc.c
+++ b/kirc.c
@@ -13,6 +13,8 @@
#include <sys/socket.h>
#include <sys/ioctl.h>
+#define VERSION "0.1.3"
+
#define MSG_MAX 512 /* guaranteed max message length */
#define CHA_MAX 200 /* guaranteed max channel length */
@@ -280,22 +282,22 @@ main(int argc, char **argv) {
while ((cval = getopt(argc, argv, "s:p:o:n:k:c:u:r:x:w:W:a:hevV")) != -1) {
switch (cval) {
- case 'V' : ++verb; break;
- case 'e' : ++sasl; break;
- case 's' : host = optarg; break;
- case 'p' : port = optarg; break;
- case 'r' : real = optarg; break;
- case 'u' : user = optarg; break;
- case 'a' : auth = optarg; break;
- case 'o' : olog = optarg; break;
- case 'n' : nick = optarg; break;
- case 'k' : pass = optarg; break;
- case 'c' : chan = optarg; break;
- case 'x' : inic = optarg; break;
- case 'w' : gutl = atoi(optarg); break;
- case 'W' : cmax = atoi(optarg); break;
- case 'v' : puts("kirc 0.1.2\n"); break;
- case '?' : usage(); break;
+ case 'V' : ++verb; break;
+ case 'e' : ++sasl; break;
+ case 's' : host = optarg; break;
+ case 'p' : port = optarg; break;
+ case 'r' : real = optarg; break;
+ case 'u' : user = optarg; break;
+ case 'a' : auth = optarg; break;
+ case 'o' : olog = optarg; break;
+ case 'n' : nick = optarg; break;
+ case 'k' : pass = optarg; break;
+ case 'c' : chan = optarg; break;
+ case 'x' : inic = optarg; break;
+ case 'w' : gutl = atoi(optarg); break;
+ case 'W' : cmax = atoi(optarg); break;
+ case 'v' : puts("kirc-" VERSION); break;
+ case '?' : usage(); break;
}
}