From 94aca244aa2de4cc9b7728f2c64d3a6add1b9efa Mon Sep 17 00:00:00 2001 From: Tobias Wiese Date: Fri, 7 Aug 2020 17:42:13 +0200 Subject: manpage for exchange.1 Add a manpage for exchage. This manual page is installed with the install and removed with the uninstall target. Signed-off-by: Tobias Wiese --- .gitignore | 2 ++ Makefile | 14 +++++++++++--- exchange.1 | 28 ++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 exchange.1 diff --git a/.gitignore b/.gitignore index 4a50cc5..0437935 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ *.[oa] *~ /exchange +# Manpages +*.1.gz diff --git a/Makefile b/Makefile index 341cd46..915330f 100644 --- a/Makefile +++ b/Makefile @@ -22,24 +22,32 @@ TARGETS := exchange MAINS := $(addsuffix .o, $(TARGETS)) OBJ := $(MAINS) +MAN1 := exchange.1 +MAN1_GZ := $(addsuffix .gz, $(MAN1)) + .PHONY: all -all: $(TARGETS) +all: $(TARGETS) $(MAN1_GZ) .PHONY: clean clean: - rm -f $(OBJ) $(TARGETS) + rm -f $(OBJ) $(TARGETS) $(MAN1_GZ) .PHONY: distclean distclean: clean .PHONY: install -install: $(TARGETS) +install: $(TARGETS) $(MAN1_GZ) $(INSTALL) -Dt "$(DESTDIR)$(prefix)/bin" $(TARGETS) + $(INSTALL) -Dt "$(DESTDIR)$(prefix)/share/man/man1" $(MAN1_GZ) .PHONY: uninstall uninstall: cd $(DESTDIR)$(prefix)/bin && rm -f $(TARGETS) + cd $(DESTDIR)$(prefix)/share/man/man1 && rm -f $(MAN1_GZ) $(TARGETS): % : %.o $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ + +$(MAN1_GZ): %.gz : % + gzip -9 -k -f $^ diff --git a/exchange.1 b/exchange.1 new file mode 100644 index 0000000..98ea52c --- /dev/null +++ b/exchange.1 @@ -0,0 +1,28 @@ +.TH EXCHANGE "1" "2020-08-07" +.SH NAME +exchange \- exchange (swap) two files +.SH SYNOPSIS +.B exchange +.RI [ OPTIONS ]... " PATH1 PATH2" +.SH DESCRIPTION +Swap the filenames of +.I PATH1 +and +.IR PATH2 . +Each of +.I PATH1 +and +.I PATH2 +may be any kind of file, including directory. +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-v, \-\-version +Show version of program. +.SH SEE ALSO +.BR mv (1), +.BR rename (2). -- cgit v1.2.3