X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=man%2Fmh-chart-gen.sh;h=396327b3561e596cf47924ee21ac17b31d65eada;hb=25581a94c5113eb78b2baf7110408df96efc4418;hp=33e2a4c583a88ef2968a7d966d97d9c413829f79;hpb=67c56bad23525bd3d5f4d155b4f602a4183c6170;p=mmh diff --git a/man/mh-chart-gen.sh b/man/mh-chart-gen.sh index 33e2a4c..396327b 100755 --- a/man/mh-chart-gen.sh +++ b/man/mh-chart-gen.sh @@ -1,7 +1,7 @@ #! /bin/sh # -# Generates mh-chart.man from other .man files that have a -# SYNOPSIS section. +# Generates mh-chart.man from other .man files that have a SYNOPSIS +# section. nmhmandir=`dirname $0` @@ -17,15 +17,17 @@ mh-chart \- Chart of nmh Commands EOF for i in $nmhmandir/*.man; do - if ! echo $i | grep 'mh-chart.man' >/dev/null; then - if grep '^\.ad' "$i" >/dev/null; then - #### Extract lines from just after .SH SYNOPSIS to just before .ad. - #### Filter out the "typical usage:" section in pick.man. - awk '/.SH SYNOPSIS/,/^(\.ad|typical usage:)/' "$i" | \ - grep -Ev '^(\.SH SYNOPSIS|\.na|\.ad|typical usage:)' - echo - fi - fi + case $i in + */mh-chart.man) ;; + *) if grep '^\.ad' "$i" >/dev/null; then + #### Extract lines from just after .SH SYNOPSIS to just before .ad. + #### Filter out the "typical usage:" section in pick.man. + awk '/.SH SYNOPSIS/,/^(\.ad|typical usage:)/ { + if ($0 !~ /^(\.SH SYNOPSIS|\.na|\.ad|typical usage:)/) print + }' "$i" + echo + fi ;; + esac done cat <<'EOF'