Commits

Jakub Wilk  committed 9440859

doc/manpage: add.

  • Participants
  • Parent commits 51e1f61

Comments (0)

Files changed (3)

 syntax: glob
 
+doc/*.1
 example/*.html
 shellcat
 tests/*.err
 version = $(shell head -n1 doc/changelog | cut -d ' ' -f2)
+pod2man = $(shell which pod2man)
 
 CC = gcc
 CFLAGS = -g -O2 -Wall -Wformat -Wextra -pedantic
 clean:
 	rm -f shellcat
 
+ifneq "$(pod2man)" ""
+
+all: doc/shellcat.1
+
+doc/shellcat.1: doc/manpage.pod
+	sed -e 's/L<\([a-z_-]\+\)(\([0-9]\+\))>/B<\1>(\2)/' $(<) \
+	| pod2man --utf8 -c '' -n shellcat -r 'shellcat $(version)' \
+	> $(@).tmp
+	mv $(@).tmp $(@)
+
+clean: clean-doc
+
+.PHONY: clean-doc
+clean-doc:
+	rm -f doc/*.1 doc/*.tmp
+
+endif
+
 # vim:ts=4 sw=4 noet

File doc/manpage.pod

+=encoding UTF-8
+
+=head1 NAME
+
+shellcat - templating system with shell syntax
+
+=head1 SYNOPSIS
+
+B<shellcat> [-s I<SHELL>] I<TEMPLATE> [I<ARG>...]
+
+B<shellcat> {-h | --help | -v | --version}
+
+=head1 DESCRIPTION
+
+B<I<TBD>>
+
+=head1 OPTIONS
+
+=over
+
+=item B<-s>, B<--shell>=I<SHELL>
+
+Use the specified shell. The default is F</bin/sh>.
+
+=item B<-h>, B<--help>
+
+Display help and exit.
+
+=item B<-v>, B<--version>
+
+Output version information and exit.
+
+=back
+
+=head1 TEMPLATE SYNTAX
+
+B<I<TBD>>
+
+=head1 ENVIRONMENT
+
+The following environment variables are available for the processes spawned by
+B<shellcat>:
+
+=over
+
+=item B<SHELLCAT>
+
+B<I<TBD>>
+
+=back
+
+=head1 SEE ALSO
+
+L<sh(1)>