Gopher/HTTP/HTTPS file grabber
git clone git://
Log | Files | Refs | README | LICENSE

commit cbccd2ddfd3cc994f06c966eb88d088e52d92159
parent af2736e8ff7e4ec1eae5500d7c6840b0a177cc23
Author: Hiltjo Posthuma <>
Date:   Fri, 16 Nov 2018 15:53:31 +0100

add initial man page, fix man path, improve make dist

MMakefile | 17+++++++----------
Ahurl.1 | 40++++++++++++++++++++++++++++++++++++++++
2 files changed, 47 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile @@ -7,7 +7,7 @@ VERSION = 0.01 PREFIX = /usr/local BINDIR = ${PREFIX}/bin -MANDIR = ${PREFIX}/share/man/man1 +MANDIR = ${PREFIX}/man/man1 CFLAGS = -O2 -Wall HURL_CFLAGS = -I. -I/usr/include ${CFLAGS} @@ -39,21 +39,18 @@ install: all mkdir -p "${DESTDIR}${BINDIR}" cp -f ${NAME} "${DESTDIR}${BINDIR}" chmod 755 "${DESTDIR}${BINDIR}/${NAME}" -# For later manpage. -# mkdir -p "${DESTDIR}${MANDIR}" -# cp -f ${NAME}.1 "${DESTDIR}${MANDIR}" -# chmod 644 "${DESTDIR}${MANDIR}/${NAME}.1" + mkdir -p "${DESTDIR}${MANDIR}" + cp -f ${NAME}.1 "${DESTDIR}${MANDIR}" + chmod 644 "${DESTDIR}${MANDIR}/${NAME}.1" uninstall: rm -f "${DESTDIR}${BINDIR}/${NAME}" -# rm -f "${DESTDIR}${MANDIR}/${NAME}.1" + rm -f "${DESTDIR}${MANDIR}/${NAME}.1" dist: clean mkdir -p ${NAME}-${VERSION} -# cp -R README LICENSE Makefile ${NAME}.1 \ -# *.c *.h ${NAME}-${VERSION} - cp -R README LICENSE Makefile \ - *.c *.h ${NAME}-${VERSION} + cp -R TODO README LICENSE Makefile ${NAME}.1 \ + ${NAME}.c arg.h ${NAME}-${VERSION} tar -cf ${NAME}-${VERSION}.tar ${NAME}-${VERSION} gzip ${NAME}-${VERSION}.tar mv ${NAME}-${VERSION}.tar.gz ${NAME}-${VERSION}.tgz diff --git a/hurl.1 b/hurl.1 @@ -0,0 +1,40 @@ +.Dd November 16, 2018 +.Dt HURL 1 +.Os +.Sh NAME +.Nm hurl +.Nd HTTP/HTTPS/Gopher file grabber +.Sh SYNOPSIS +.Nm +.Op Fl H Ar header +.Op Fl m Ar filesize +.Op Fl t Ar timeout +.Ar url +.Sh DESCRIPTION +.Nm +fetches data and writes it to stdout. +.Nm +supports the protocols: HTTP, HTTPS and Gopher. +.Pp +The options are as follows: +.Bl -tag -width Ds +.It Fl H Ar header +Add custom raw data to HTTP header (HTTP/HTTPS only). +.It Fl m Ar filesize +Maximum size of the data in bytes. +.It Fl t Ar timeout +Maximum time for the connection and fetching the data in seconds. +.El +.Pp +For HTTP and HTTPS it will write the data except the header to stdout when the +HTTP statuscode is "200 OK" and exit with statuscode 0 when all data is +successfully written. When the header is retrieved but it is not "200 OK" it +will write the HTTP header to stderr and exit with a non-zero statuscode. +.Pp +For Gopher it will write the data to stdout and exit with statuscode 0 when all +data is successfully written. +.Sh SEE ALSO +.Xr ftp 1 , +.Xr nc 1 +.Sh AUTHORS +.An Hiltjo Posthuma Aq Mt