From 6c1b7385c2a716407af85708827f0ae80f589fdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Sat, 17 Aug 2019 20:42:30 +0300 Subject: [PATCH] Add man pages --- Makefile | 6 +++++- plainhex.1 | 17 +++++++++++++++++ plainunhex.1 | 18 ++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 plainhex.1 create mode 100644 plainunhex.1 diff --git a/Makefile b/Makefile index 3dfbf5e..ac751e3 100644 --- a/Makefile +++ b/Makefile @@ -2,12 +2,15 @@ DESTDIR ?= PREFIX ?= /usr/local EXEC_PREFIX ?= $(PREFIX) BINDIR ?= $(EXEC_PREFIX)/bin +DATAROOTDIR ?= $(PREFIX)/share +MANDIR ?= $(DATAROOTDIR)/man CFLAGS += -Os -g -Wall -Wextra -pedantic CPPFLAGS += LDFLAGS += BINS := plainhex plainunhex +MAN1S := plainhex.1 plainunhex.1 .SUFFIXES: .SUFFIXES: .c .o @@ -24,8 +27,9 @@ plainunhex: plainunhex.o .c.o: $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $< -install: $(BINS) +install: $(BINS) $(MAN1S) install -D -m 755 -t '$(DESTDIR)$(BINDIR)' $(BINS) + install -D -m 644 -t '$(DESTDIR)$(MANDIR)/man1' $(MAN1S) uninstall: cd $(DESTDIR)$(BINDIR) && rm $(BINS) diff --git a/plainhex.1 b/plainhex.1 new file mode 100644 index 0000000..a94c8fe --- /dev/null +++ b/plainhex.1 @@ -0,0 +1,17 @@ +.Dd Aug 17, 2019 +.Dt PLAINHEX 1 +.Os +.Sh NAME +.Nm plainhex +.Nd most basic possible hexdump +.Sh SYNOPSIS +.Nm +.Sh DESCRIPTION +.Nm +reads bytes from stdin and writes them hex-encoded to stdout. +There is no line-wrapping, padding, or field separation. +The hexdump is ended with a single newline. +.Sh EXIT STATUS +.Ex -std +.Sh SEE ALSO +.Xr plainunhex 1 diff --git a/plainunhex.1 b/plainunhex.1 new file mode 100644 index 0000000..bf34299 --- /dev/null +++ b/plainunhex.1 @@ -0,0 +1,18 @@ +.Dd Aug 17, 2019 +.Dt PLAINUNHEX 1 +.Os +.Sh NAME +.Nm plainunhex +.Nd most basic possible hexundump +.Sh SYNOPSIS +.Nm +.Sh DESCRIPTION +.Nm +reads pairs of hex digits from the stdin and writes the corresponding bytes +to stdout. +Both lowercase and uppercase hex digits are supported. +Everything that is not a hex digit is ignored. +.Sh EXIT STATUS +.Ex -std +.Sh SEE ALSO +.Xr plainhex 1