docs: Generate grammar and option summaries from manpage.
[fwd] / fw.1.in
diff --git a/fw.1 b/fw.1.in
similarity index 89%
rename from fw.1
rename to fw.1.in
index 51dc460..542e48b 100644 (file)
--- a/fw.1
+++ b/fw.1.in
@@ -59,6 +59,8 @@
 .de GE
 .PP
 ..
+.de GL
+..
 .
 .de OS
 .PP
@@ -69,6 +71,8 @@
 .de OE
 .RE
 ..
+.de OL
+..
 .
 .\" --- Other bits of styling ---
 .
@@ -477,7 +481,7 @@ is good enough for setting global options, and the implicit context
 disambiguates local options.
 .PP
 The following file attribute options are supported:
-.OS "File attribute options (`fattr')"
+.OS "File attributes (`fattr')"
 .IB prefix .fattr.mode
 .RB [ = ]
 .I mode
@@ -495,7 +499,7 @@ and
 .RB ` , '
 do not have to be quoted within the mode string.
 .OE
-.OS "File attribute options (`fattr')"
+.OS "File attributes (`fattr')"
 .IB prefix .fattr.owner
 .RB [ = ]
 .I user
@@ -511,7 +515,7 @@ and
 are accepted in place of
 .BR owner .
 .OE
-.OS "File attribute options (`fattr')"
+.OS "File attributes (`fattr')"
 .IB prefix .fattr.group
 .RB [ = ]
 .I group
@@ -542,7 +546,7 @@ is used as a source, it is set up immediately.
 The syntax of
 .B file
 sources and targets is like this:
-.GS "File sources and targets"
+.GS "File source and target"
 .I source
 ::=
 .I file
@@ -680,7 +684,7 @@ an error is reported.  If
 the new data is appended to the file.
 .OE
 .OS "File options"
-.BR file.fattr.*
+.BR file.fattr. *
 .OD
 The
 .B file
@@ -706,7 +710,7 @@ which is as follows:
 .br
 .I target
 ::=
-exec
+.I exec
 .br
 .I exec
 ::=
@@ -875,7 +879,7 @@ The soft limit cannot be set above the hard limit.
 .OD
 Clears the program's environment.
 .OE
-.PP
+.OS "Exec options"
 .B exec.env.unset
 .I var
 .OD
@@ -997,6 +1001,8 @@ log messages are not generated.
 Address types also provide their own options.
 .
 .SS "The `inet' socket address type"
+.GL "Socket source and target"
+.OL "Socket options"
 The
 .B inet
 address type provides access to TCP ports.  The
@@ -1041,7 +1047,7 @@ source address accepts the following options:
 .OS "Socket options"
 .B socket.inet.source.addr
 .RB [ = ]
-.RR any | \c
+.BR any | \c
 .I addr
 .OD
 Specify the IP address on which to listen for incoming connections.  The
@@ -1078,7 +1084,7 @@ the range 0--1023.
 .OS "Socket options"
 .B socket.inet.dest.addr
 .RB [ = ]
-.RR any | \c
+.BR any | \c
 .I addr
 .OD
 Specify the IP address to bind the local socket to when making an
@@ -1128,6 +1134,8 @@ of the last entry tried.  If there are no entries defined, the default
 is to allow all clients.
 .
 .SS "The `unix' socket address type"
+.GL "Socket source and target"
+.OL "Socket options"
 The
 .B unix
 address type allows access to Unix-domain sockets.  The syntax for
@@ -1227,330 +1235,11 @@ just logs a message about the signal and continues.
 .\"--------------------------------------------------------------------------
 .SH "GRAMMAR SUMMARY"
 .
-.SS "Basic syntax"
-.I file
-::=
-.I empty
-|
-.I file
-.I stmt
-.RB [ ; ]
-.br
-.I stmt
-::=
-.I option-stmt
-|
-.I fw-stmt
-.br
-.I fw-stmt
-::=
-.B fw
-.I source
-.I options
-.RB [ to | \-> ]
-.I target
-.I options
-.br
-.I options
-::=
-.B {
-.I option-seq
-.B }
-.br
-.I option-seq
-::=
-.I empty
-|
-.I option-stmt
-.RB [ ; ]
-.I option-seq
-.
-.SS "Option syntax"
-.I option-stmt
-::=
-.I q-option
-.br
-.I q-option
-::=
-.I option
-.br
-       |
-.I prefix
-.B .\&
-.I q-option
-.br
-       |
-.I prefix
-.B {
-.I option-seq
-.B }
-.br
-.I prefix
-::=
-.I word
-.
-.SS "File source and target"
-.I source
-::=
-.I file
-.br
-.I target
-::=
-.I file
-.br
-.I file
-::=
-.B file
-.RB  [ .\& ]
-.I fspec
-.RB [ ,
-.IR fspec ]
-.br
-.I fspec
-::=
-.I fd-spec
-|
-.I name-spec
-|
-.I null-spec
-.br
-.I fd-spec
-::=
-.RB [[ : ] fd [ : ]]
-.IR number \c
-.RB | stdin | stdout
-.br
-.I name-spec
-::=
-.RB [[ : ] name [ : ]]
-.I file-name
-.br
-.I file-name
-::=
-.I path-seq
-|
-.B [
-.I path-seq
-.B ]
-.br
-.I path-seq
-::=
-.I path-elt
-|
-.I path-seq
-.I path-elt
-.br
-.I path-elt
-::=
-.B /
-|
-.I word
-.br
-.I null-spec
-::=
-.RB [ : ] null [ : ]
-.
-.SS "Exec source and target"
-.I source
-::=
-.I exec
-.br
-.I target
-::=
-exec
-.br
-.I exec
-::=
-.BR exec
-.RB [ .\& ]
-.I cmd-spec
-.br
-.I cmd-spec
-::=
-.I shell-cmd
-|
-.RI [ prog-name ]
-.B [
-.I argv0
-.I arg-seq
-.B ]
-.br
-.I arg-seq
-::=
-.I word
-|
-.I arg-seq
-.I word
-.br
-.I shell-cmd
-::=
-.I word
-.br
-.I argv0
-::=
-.I word
-.
-.SS "Socket source and target"
-.ll +8i
-.I source
-::=
-.I socket-source
-.br
-.I target
-::=
-.I socket-target
-.br
-.I socket-source
-::=
-.RB [ socket [ .\& ]]
-.RB [[ : ] \c
-.IR addr-type \c
-.RB [ : ]]
-.I source-addr
-.br
-.I socket-target
-::=
-.RB [ socket [ .\& ]]
-.RB [[ : ] \c
-.IR addr-type \c
-.RB [ : ]]
-.I target-addr
-.ll -8i
-.PP
-.I inet-source-addr
-::=
-.RB [ port ]
-.I port
-.br
-.I inet-target-addr
-::=
-.I address
-.RB [ : ]
-.I port
-.br
-.I address
-::=
-.I addr-elt
-|
-.I address
-.I addr-elt
-.br
-.I addr-elt
-::=
-.B .\&
-|
-.I word
-.PP
-.I unix-source-addr
-::=
-.I file-name
-.br
-.I unix-target-addr
-::=
-.I file-name
-.
+@@@ grammar
 .\"--------------------------------------------------------------------------
 .SH "OPTION SUMMARY"
 .
-.SS "File attributes (`fattr')"
-.IB prefix .fattr.mode
-.RB [ = ]
-.I mode
-.br
-.IB prefix .fattr.owner
-.RB [ = ]
-.I user
-.br
-.IB prefix .fattr.group
-.RB [ = ]
-.I group
-.
-.SS "File options"
-.B file.create
-.RB [ = ]
-.BR yes | no
-.br
-.B file.open
-.RB [ = ]
-.BR no | truncate | append
-.br
-.BR file.fattr. *
-.
-.SS "Exec options"
-.B exec.logging
-.RB [ = ]
-.BR yes | no
-.br
-.B exec.dir
-.RB [ = ]
-.I file-name
-.br
-.B exec.root
-.RB [ = ]
-.I file-name
-.br
-.B exec.user
-.RB [ = ]
-.I user
-.br
-.B exec.group
-.RB [ = ]
-.I group
-.br
-.BI exec.rlimit. limit \c
-.RB [ .hard | .soft ]
-.RB [ = ]
-.I value
-.br
-.B exec.env.clear
-.br
-.B exec.env.unset
-.I var
-.br
-.BR exec.env. [ set ]
-.I var
-.RB [ = ]
-.I value
-.
-.SS "Socket options"
-.B socket.conn
-.RB [ = ]
-.IR number | \c
-.BR unlimited | one-shot
-.br
-.B socket.listen
-.RB [ = ]
-.I number
-.br
-.B socket.logging
-.RB [ = ]
-.BR yes | no
-.PP
-.BR socket.inet.source. [ allow | deny ]
-.RB [ host ]
-.I addr
-.RB [ /
-.IR addr ]
-.br
-.BR socket.inet.source. [ allow | deny ]
-.B priv-port
-.br
-.B socket.inet.source.addr
-.RB [ = ]
-.BR any | \c
-.I addr
-.br
-.B socket.inet.dest.addr
-.RB [ = ]
-.BR any | \c
-.I addr
-.br
-.B socket.inet.dest.priv-port
-.RB [=]
-.BR yes | no
-.PP
-.BR socket.unix.fattr. *
-.
+@@@ option
 .\"--------------------------------------------------------------------------
 .SH "BUGS"
 .