]>
diplodocus.org Git - nmh/blob - man/mh-chart-gen.sh
3 # Generates mh-chart.man from other .man files that have a SYNOPSIS
6 # This code is Copyright (c) 2012, by the authors of nmh.
7 # See the COPYRIGHT file in the root directory of the nmh
8 # distribution for complete copyright information.
10 nmhmandir
=`dirname $0`
12 # The following ensures the generated date field in the manpage is divorced
13 # from the local build environment when building distribution packages.
14 LC_TIME
=C
; export LC_TIME
16 datestamp
=`date '+%B %d, %Y'`
19 .TH MH-CHART %manext7% "${datestamp}" "%nmhversion%"
24 mh-chart \- Chart of nmh Commands
29 for i
in $nmhmandir/*.man
; do
32 *) if grep '^\.ad' "$i" >/dev
/null
; then
33 #### Extract lines from just after .SH SYNOPSIS to just before .ad.
34 #### Filter out the "typical usage:" section in pick.man.
35 awk '/.SH SYNOPSIS/,/^(\.ad|typical usage:)/ {
36 if ($0 !~ /^(\.SH SYNOPSIS|\.na|\.ad|typical usage:)/) print