From 499403425ac1ac02cf437910e338b2ef93a092c8 Mon Sep 17 00:00:00 2001 From: Michael Czigler <37268479+mcpcpc@users.noreply.github.com> Date: Tue, 29 Sep 2020 17:53:44 -0400 Subject: add manpage (#46) * Create kirc.1 * add VERSION and man page * change kirc version to definition in Makefile * fix separator char (TAB) * remove double parenthesis in puts() command * change VERSION to be controlled by kirc.c --- Makefile | 6 +++++ kirc.1 | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ kirc.c | 34 ++++++++++++++-------------- 3 files changed, 101 insertions(+), 16 deletions(-) create mode 100644 kirc.1 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 / +Send message to IRC host (e.g. /JOIN, /PART, /WHOIS, etc.) +.TP +.BI /? +Print current default message channel +.TP +.BI /# +Set default message channel to +.TP +.BI +Send PRIVMSG to default message channel with as the content +.TP +.BI /@ +Send PRIVMSG to specified or +.SH AUTHOR +Michael Czigler +.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 #include +#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; } } -- cgit v1.2.3