commit: 09888267e7b3d337ea561a627dfa559f885c2085
parent: d2d5044bd93e9a4193b701fda49dd7b0c11831d2
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sun, 3 Mar 2019 06:32:54 +0100
new-manpage.sh: New helper
Diffstat:
2 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/README b/README
@@ -4,5 +4,8 @@ Seeing how POSIX is basically slow by design, this is an attempt to provide docu
## Authors
Haelwenn (lanodan) Monnier <contact@hacktivis.me>: Gentoo Linux user and contributor, I often look at Alpine Linux, Void Linux, NetBSD, OpenBSD and 9front (non-exhaustive, non-ordered).
+## Contribution
+Usage of `new-manpage.sh` is recommended, to which you should change the Author section.
+
## See Also
* [Rosetta Stone for Unix](http://bhami.com/rosetta.html): translation cheatsheet between Unix systems
diff --git a/new-manpage.sh b/new-manpage.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+name="$2"
+section="${1}x"
+
+usage() {
+ echo "${0} <section> <name>"
+ echo "where section is one of [1-8]"
+ exit 1
+}
+
+[[ -z "$name" ]] && usage
+[[ -z "$section" ]] && usage
+
+man_file=man${section}/${name}.${section}
+
+cat >"${man_file}" <<EOF
+.Dd $(date +%F)
+.Dt ${name} ${section}
+.Os
+.Sh PROLOG
+This manual page is part of
+.Lk https://hacktivis.me/git/docs "Cross-Unix Documentation"
+which is an attempt to provide documentation of similarities and (noteworthy) differencies between Unix-like systems. To be used as an addition to the POSIX standard.
+.Sh NAME
+.Nm ${name}
+.Sh SYNOPSIS
+.Sh DESCRIPTION
+.Sh SOURCE
+.Sh AUTHORS
+.An Haelwenn (lanodan) Monnier Aq Mt contact@hacktivis.me
+EOF
+
+$EDITOR ${man_file}