## cmd-doc.tlib -- Template for command line man/mdoc pages
##
-## Time-stamp: "2011-03-04 11:08:00 bkorb"
+## Time-stamp: "2011-05-27 17:51:16 bkorb"
##
## This file is part of AutoOpts, a companion to AutoGen.
## AutoOpts is free software.
(define tmp-val (getenv "MAN_SECTION"))
(define man-sect (if (exist? "cmd-section") (get "cmd-section") "1"))
+(define file-name "")
+(define tmp-str "")
(if (defined? 'tmp-val)
(if (string? tmp-val)
do cat_n_rm $f ; done
test -f ${tmp_dir}/name && rm -f ${tmp_dir}/name
-for f in implementation-notes environment files examples exit-status \
+for f in implementation-notes environment files examples exit-status errors \
compatibility notes see-also conforming-to history authors bugs
do cat_n_rm $f ; done > ${tmp_dir}/.fini
INVOKE options :+][+:
INVOKE exit-status :+][+:
INVOKE authors :+][+:
+INVOKE bugs :+][+:
IF (or home-rc-files environ-init) :+][+:
.\" A U T H O R S
.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = :+][+:
-DEFINE authors :+][+:
+DEFINE authors :+][+:
-IF (not (access? (string-append tmp-dir "/authors") R_OK)) :+][+:
- (set! tmp-val (get "copyright.eaddr" (get "eaddr")))
- (if (> (string-length tmp-val) 1)
- (shellf
- "printf '%s\\n' > ${tmp_dir}/authors"
- tmp-val ) ) :+][+:
-ENDIF :+][+:
+IF (set! file-name (string-append tmp-dir "/authors"))
+ (not (access? file-name R_OK)) :+][+:
+
+ (out-push-new file-name)
+ (define remove-authors #t)
+
+ (set! tmp-val
+ (get "copyright.author" (get "copyright.owner")) )
+
+ (if (> (string-length tmp-val) 1)
+ (ag-fprintf 0 ".Sh AUTHORS\n%s\n" tmp-val))
+
+ (out-pop) :+][+:
+ENDIF copyright author/owner :+][+:
+
+ENDDEF authors
-(set! tmp-val (string-append tmp-dir "/authors"))
-(out-push-new tmp-val) :+][+:
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+.\" B U G S
+.\"
+.\" This section is guaranteed to be the last section in the man page
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = :+][+:
+
+DEFINE bugs :+][+:
-CASE copyright.type :+][+:
+IF (set! file-name (string-append tmp-dir "/bugs"))
+ (access? file-name R_OK) :+][+:
+ (out-push-add file-name) :+][+:
+ELSE :+][+:
+ (out-push-new file-name)
+ (set! tmp-val (get "copyright.eaddr" (get "eaddr")))
+ (if (> (string-length tmp-val) 1)
+ (ag-fprintf 0 ".Sh BUGS\nPlease send bug reports to: %s\n" tmp-val))
+:+][+:
+ENDIF :+][+:
+
+ CASE copyright.type :+][+:
= gpl :+]
.Pp
-Released under the GNU General Public License.[+:
+This program is released under the GNU General Public License.[+:
= lgpl :+]
.Pp
-Released under the GNU General Public License with Library Extensions.[+:
+This program is released under the GNU General Public License
+with Library Extensions.[+:
= bsd :+]
.Pp
-Released under the Free BSD License.[+:
+This program is released under the Free BSD License.[+:
* :+][+:
- IF (exist? "copyright.text")
+ IF (exist? "copyright.text")
:+]
.Pp
.nf
[+: copyright.text :+]
.fi
.ad[+:
- ELIF (exist? "copyright.date") :+]
+ ELIF (exist? "copyright.date") :+]
.Pp
Released under an unspecified copyright license.[+:
- ENDIF :+][+:
-ESAC :+]
+ ENDIF :+][+:
+ ESAC :+]
.Pp
-This manual page was \fIAutoGen\fP-erated from the
-.Nm
+This manual page was \fIAutoGen\fP-erated from the \fB[+: prog-name :+]\fP
option definitions.[+:
(out-pop) :+][+:
-ENDDEF authors
-
-.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
-.\" B U G S
-.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = :+][+:
-
-DEFINE bugs :+][+:
-IF (not (access? (string-append tmp-dir "/bugs") R_OK)) :+][+:
- (set! tmp-val (get "copyright.eaddr" (get "eaddr")))
- (if (> (string-length tmp-val) 1) (shellf
- "printf 'Please send bug reports to: %s\\n' > ${tmp_dir}/bugs"
- tmp-val ) ) :+][+:
-ENDIF :+][+:
ENDDEF bugs
.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =