3 cat "$1" |
awk -v fmt="$2" '
17 for(i=2; i<=NF; i+=1) {
21 name = substr(name, 1, length(name)-1);
22 _fname = docdir "/" fmt "/" substr(fname, 1, length(fname)-1)
23 fname = _fname "." fmt;
25 print "Writing out ", fname;
27 print "\\input{" _fname "}" >> "cp-cmd-list.tex"
29 print "\\section{" name "}" > fname;
35 print "\\begin{syntdiag}" >> fname;
41 print "\\end{syntdiag}" >> fname;
47 print "\\subsection*{Authorization}\nPriviledge Class: " $3 >> fname;
51 /^[/ ]\*!! PURPOSE$/ {
53 print "\\subsection*{Purpose}" >> fname;
57 /^[/ ]\*!! EXAMPLES$/ {
59 print "\\subsection*{Examples}" >> fname;
63 /^[/ ]\*!! OPERANDS$/ {
65 print "\\subsection*{Operands}" >> fname;
66 print "\\begin{description}" >> fname
70 /^[/ ]\*!! SDNAREPO$/ {
72 print "\\end{description}" >> fname;
76 /^[/ ]\*!! OPTIONS$/ {
78 print "\\subsection*{Options}" >> fname;
79 print "\\begin{description}" >> fname;
83 /^[/ ]\*!! SNOITPO$/ {
85 print "\\end{description}" >> fname;
91 print "\\subsection*{Usage Notes}" >> fname;
92 print "\\begin{enumerate}" >> fname;
98 print "\\end{enumerate}" >> fname;
104 if (mode == "copy" || mode == "syntax")
105 print substr($0, 5) >> fname;
109 if (mode == "copy" || mode == "syntax")
110 print substr($0, 5) >> fname;
115 rm -f cp-cmd-list.tex
118 for srcf
in ..
/..
/cp
/shell
/cmd_
*.c
; do
119 echo "Inspecting $srcf..."
121 #write_docs $srcf txt
122 #write_docs $srcf html
125 sort < cp-cmd-list.tex
> cp-cmd-list.tex
.2
126 mv cp-cmd-list.tex
.2 cp-cmd-list.tex