quark.1: add manpage

quark.c: alphabeticly sort options, like in the manpage.
Makefile: add manpage rule to Makefile and fix make dist.
This commit is contained in:
Hiltjo Posthuma 2014-08-20 14:25:58 +00:00 committed by FRIGN
parent 43c4400a77
commit c00949d37d
3 changed files with 72 additions and 3 deletions

View file

@ -34,7 +34,7 @@ clean:
dist: clean dist: clean
@echo creating dist tarball @echo creating dist tarball
@mkdir -p quark-${VERSION} @mkdir -p quark-${VERSION}
@cp -R LICENSE Makefile README config.mk ${SRC} quark-${VERSION} @cp -R LICENSE Makefile README config.mk quark.1 arg.h config.def.h ${SRC} quark-${VERSION}
@tar -cf quark-${VERSION}.tar quark-${VERSION} @tar -cf quark-${VERSION}.tar quark-${VERSION}
@gzip quark-${VERSION}.tar @gzip quark-${VERSION}.tar
@rm -rf quark-${VERSION} @rm -rf quark-${VERSION}
@ -44,9 +44,14 @@ install: all
@mkdir -p ${DESTDIR}${PREFIX}/bin @mkdir -p ${DESTDIR}${PREFIX}/bin
@cp -f quark ${DESTDIR}${PREFIX}/bin @cp -f quark ${DESTDIR}${PREFIX}/bin
@chmod 755 ${DESTDIR}${PREFIX}/bin/quark @chmod 755 ${DESTDIR}${PREFIX}/bin/quark
@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
@sed "s/VERSION/${VERSION}/g" < quark.1 > ${DESTDIR}${MANPREFIX}/man1/quark.1
uninstall: uninstall:
@echo removing executable file from ${DESTDIR}${PREFIX}/bin @echo removing executable file from ${DESTDIR}${PREFIX}/bin
@rm -f ${DESTDIR}${PREFIX}/bin/quark @rm -f ${DESTDIR}${PREFIX}/bin/quark
@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
@rm -f ${DESTDIR}${MANPREFIX}/man1/quark.1
.PHONY: all options clean dist install uninstall .PHONY: all options clean dist install uninstall

62
quark.1 Normal file
View file

@ -0,0 +1,62 @@
.TH QUARK 1 quark\-VERSION
.SH NAME
quark \- simple httpd
.SH SYNOPSIS
.B quark
.RB [ \-c ]
.RB [ \-d
.IR cgidir ]
.RB [ \-e
.IR cgiscript ]
.RB [ \-g
.IR group ]
.RB [ \-i
.IR index ]
.RB [ \-l ]
.RB [ \-p
.IR port ]
.RB [ \-r
.IR docroot ]
.RB [ \-s
.IR server ]
.RB [ \-u
.IR user ]
.RB [ \-v ]
.SH DESCRIPTION
Quark is a simple httpd.
.SH OPTIONS
.TP
.B \-c
enable CGI-mode, disabled by default.
.TP
.B \-d " cgidir"
change directory to cgidir for CGI-mode, by default ".".
.TP
.B \-e " cgiscript"
CGI-script to execute for each request in CGI-mode, by default "/werc.rc".
.TP
.B \-g " group"
change process group to group, by default "nobody".
.TP
.B \-i " indexfile"
index file, by default "index.html".
.TP
.B \-l
enable directory listing, disabled by default.
.TP
.B \-p
listen on port, by default "80".
.TP
.B \-r " docroot"
change directory to docroot, by default ".".
.TP
.B \-s " server"
listen on server, by default "127.0.0.1".
.TP
.B \-u " user"
change process owner to user, by default "nobody".
.TP
.B \-v
show version information.
.SH BUGS
Please report them!

View file

@ -554,8 +554,10 @@ sighandler(int sig) {
void void
usage(void) { usage(void) {
die("usage: %s [-c] [-d cgidir] [-e cgiscript] [-u user] [-g group] " fprintf(stderr, "usage: quark [-c] [-d cgidir] [-e cgiscript] [-g group] "
"[-i index] [-l] [-r docroot] [-s server] [-p port] [-v]\n", argv0); "[-i index] [-l] [-p port] [-r docroot] [-s server] "
"[-u user] [-v]\n");
exit(EXIT_FAILURE);
} }
int int