summaryrefslogtreecommitdiff
path: root/mdoc2man.awk
diff options
context:
space:
mode:
Diffstat (limited to 'mdoc2man.awk')
-rw-r--r--mdoc2man.awk18
1 files changed, 17 insertions, 1 deletions
diff --git a/mdoc2man.awk b/mdoc2man.awk
index d6eaf460..89f36673 100644
--- a/mdoc2man.awk
+++ b/mdoc2man.awk
@@ -1,6 +1,9 @@
#!/usr/bin/awk
#
+# $Id: mdoc2man.awk,v 1.5.10.1 2007/06/05 10:05:38 dtucker Exp $
+#
# Version history:
+# v4+ Adapted for OpenSSH Portable (see cvs Id and history)
# v3, I put the program under a proper license
# Dan Nelson <dnelson@allantgroup.com> added .An, .Aq and fixed a typo
# v2, fixed to work on GNU awk --posix and MacOS X
@@ -135,6 +138,12 @@ function add(str) {
nospace=0
}
if(match(words[w],"^Dd$")) {
+ if(match(words[w+1],"^\\$Mdocdate:")) {
+ w++;
+ if(match(words[w+4],"^\\$$")) {
+ words[w+4] = ""
+ }
+ }
date=wtail()
next
} else if(match(words[w],"^Dt$")) {
@@ -157,6 +166,7 @@ function add(str) {
refissue=""
refdate=""
refopt=""
+ refreport=""
reference=1
next
} else if(match(words[w],"^Re$")) {
@@ -168,9 +178,14 @@ function add(str) {
}
if(nrefauthors>1)
add(" and ")
- add(refauthors[0] ", \\fI" reftitle "\\fP")
+ if(nrefauthors>0)
+ add(refauthors[0] ", ")
+ add("\\fI" reftitle "\\fP")
if(length(refissue))
add(", " refissue)
+ if(length(refreport)) {
+ add(", " refreport)
+ }
if(length(refdate))
add(", " refdate)
if(length(refopt))
@@ -187,6 +202,7 @@ function add(str) {
if(match(words[w],"^%N$")) { refissue=wtail() }
if(match(words[w],"^%D$")) { refdate=wtail() }
if(match(words[w],"^%O$")) { refopt=wtail() }
+ if(match(words[w],"^%R$")) { refreport=wtail() }
} else if(match(words[w],"^Nm$")) {
if(synopsis) {
add(".br")