mirror of https://github.com/omar-polo/gmid.git
document macros: both -D and syntax
This commit is contained in:
parent
6b86655a10
commit
8b743ddacb
41
gmid.1
41
gmid.1
|
@ -22,6 +22,7 @@
|
||||||
.Bk -words
|
.Bk -words
|
||||||
.Op Fl fnv
|
.Op Fl fnv
|
||||||
.Op Fl c Ar config
|
.Op Fl c Ar config
|
||||||
|
.Op Fl D Ar macro Ns = Ns Ar value
|
||||||
.Op Fl P Ar pidfile
|
.Op Fl P Ar pidfile
|
||||||
.Ek
|
.Ek
|
||||||
.Nm
|
.Nm
|
||||||
|
@ -48,6 +49,15 @@ The options are as follows:
|
||||||
.Bl -tag -width 14m
|
.Bl -tag -width 14m
|
||||||
.It Fl c Pa config
|
.It Fl c Pa config
|
||||||
Specify the configuration file.
|
Specify the configuration file.
|
||||||
|
.It Fl D Ar macro Ns = Ns Ar value
|
||||||
|
Define
|
||||||
|
.Ar macro
|
||||||
|
to be set to
|
||||||
|
.Ar value
|
||||||
|
on the command line.
|
||||||
|
Overrides the definition of
|
||||||
|
.Ar macro
|
||||||
|
in the config file if present.
|
||||||
.It Fl f
|
.It Fl f
|
||||||
Stays and logs on the foreground.
|
Stays and logs on the foreground.
|
||||||
.It Fl n
|
.It Fl n
|
||||||
|
@ -112,8 +122,11 @@ The root directory to serve.
|
||||||
By default the current working directory is assumed.
|
By default the current working directory is assumed.
|
||||||
.El
|
.El
|
||||||
.Sh CONFIGURATION FILE
|
.Sh CONFIGURATION FILE
|
||||||
The configuration file is divided into two sections:
|
The configuration file is divided into three sections:
|
||||||
.Bl -tag -width xxxx
|
.Bl -tag -width xxxx
|
||||||
|
.It Sy Macros
|
||||||
|
User-defined variables may be defined and used later, simplifying the
|
||||||
|
configuration file.
|
||||||
.It Sy Global Options
|
.It Sy Global Options
|
||||||
Global settings for
|
Global settings for
|
||||||
.Nm .
|
.Nm .
|
||||||
|
@ -131,6 +144,32 @@ or
|
||||||
.Sq off .
|
.Sq off .
|
||||||
A string is a sequence of characters wrapped in double quotes,
|
A string is a sequence of characters wrapped in double quotes,
|
||||||
.Dq like this .
|
.Dq like this .
|
||||||
|
.Pp
|
||||||
|
Strict ordering of the sections is not enforced, so that is possible
|
||||||
|
to mix macros, options and
|
||||||
|
.Ic server
|
||||||
|
blocks.
|
||||||
|
However, defining all the
|
||||||
|
.Ic server
|
||||||
|
blocks after the macros and the global options is recommended.
|
||||||
|
.Ss Macros
|
||||||
|
Macros can be defined that will later be expanded in context.
|
||||||
|
Macro names must start with a letter, digit or underscore and may
|
||||||
|
contain any of those characters.
|
||||||
|
Macro names may not be reserved words.
|
||||||
|
Macros are expanded inside the quotes too.
|
||||||
|
.Pp
|
||||||
|
For example:
|
||||||
|
.Bd -literal -offset indent
|
||||||
|
dir = "/var/gemini"
|
||||||
|
cert = "/etc/keys"
|
||||||
|
|
||||||
|
server "foo" {
|
||||||
|
root "$dir/foo" # -> /var/gemini/foo
|
||||||
|
cert "$cert/foo.crt" # -> /etc/keys/foo.crt
|
||||||
|
key "$cert/foo.pem" # -> /etc/keys/foo.pem
|
||||||
|
}
|
||||||
|
.Ed
|
||||||
.Ss Global Options
|
.Ss Global Options
|
||||||
.Bl -tag -width 12m
|
.Bl -tag -width 12m
|
||||||
.It Ic chroot Pa path
|
.It Ic chroot Pa path
|
||||||
|
|
Loading…
Reference in New Issue