for i in $* do case $LANG in "") eval B\="\$`expr $i : '.*\.\([^.]*\)$'`"
test "$B" || { echo "$0: unknown suffix: $i; assuming c"1>&2; B=$c; }
esac
sed '
/^'"$B"'++/,/^'"$B"'--/!d
/^'"$B"'++/d
/^'"$B"'--/d
s/[ ]*$//
/^'"$B"' \([A-Z]\)/{
s//\1/
/^NAME[ ]*$/{
N
s/^.*\n'"$B"'[ ]*//
s/[ ]*$//
h
s/,.*\( [0-9][^ ]*\)$/\1/
y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/
s/^.*$/.TH & '"$SECT"'\
.ad\
.fi\
.SH NAME/
p
g
s/[ ][ ]*[0-9][ ]*$//
a\
\\-
p
d
}
/^SUMMARY/d
/^DESCRIPTION/s//.SH &\
.ad\
.fi/
/^BUGS/s//.SH &\
.ad\
.fi/
/^DIAGNOSTICS/s//.SH &\
.ad\
.fi/
/^HISTORY/s//.SH &\
.ad\
.fi/
/^[A-Z][A-Za-z][A-Za-z].*$/s//.SH "&"\
.na\
.nf/
p
d
}
s/^'"$B"' *//
s/^ //
s/^[ ]*$//
/^\\"/d
/^\./{
s/\([^ ]\)-/\1\\-/g
}
/^'"'"'/{
s/^/\\\&/
}
/^[^.]/{
s/-/\\-/g
} ' $i
done | expand
exit
#++
# NAME
# srctoman 1
# SUMMARY
# extract manual page from source file comment
# PACKAGE
# sdetools
# SYNOPSIS
# srctoman [-|-awk|-c|-f|-mk|-m|-n|-p|-t|-r|-C] [section] file(s)
# DESCRIPTION
# \fIsrctoman\fR converts comments in various programming languages to
# UNIX-style manual pages.
# The command processes comments in the style of newsrc(1);
# its standard output is suitable for formatting with nroff(1) or
# troff(1) using the "-man" macro package.
# Typically, srctoman is invoked from make(1) scripts.
#
# Source files are processed in the indicated order; if no
# files are specified the command produces no output.
#
# The source file language can be specified through a command-line
# option, or can be implied by the filename suffix.
# The expected start-of-comment symbol is shown in the last column.
#
# .nf
# .ft C
option language comment
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.