comparison doc/html/misc/configuration-syntax.md @ 260:904ee87bc808

CMake: split documentation into several topic, closes #535
author David Demelier <markand@malikania.fr>
date Wed, 14 Sep 2016 13:36:06 +0200
parents
children 5795a1769de5
comparison
equal deleted inserted replaced
259:0fd0290d61b4 260:904ee87bc808
1 ---
2 title: Configuration file format
3 guide: yes
4 toc: yes
5 ---
6
7 Both `irccd` and `irccdctl` use configuration file in a extended [INI][ini] format.
8
9 # General syntax
10
11 The file syntax has following rules:
12
13 1. Each option is stored in a section,
14 2. Some sections may be redefined multiple times,
15 3. Empty option must have quotes (e.g. `option = ""`).
16
17 # The @include statement
18
19 Irccd adds an extension to this format by adding an `@include` keyword which let you splitting your configuration file.
20
21 <div class="alert alert-info" role="alert">
22 **Note:** this `@include` statement must be at the beginning of the file and must be surrounded by quotes if the file
23 name has spaces.
24 </div>
25
26 You can use both relative or absolute paths. If relative paths are used, they are relative to the current file being
27 parsed.
28
29 ## Example
30
31 ````ini
32 @include "rules.conf"
33 @include "servers.conf"
34
35 [mysection]
36 myoption = "1"
37 ````
38
39 # The list construct
40
41 When requested, an option can have multiples values in a list. The syntax uses parentheses and values are separated
42 by commas.
43
44 If the list have only one value, you can just use a simple string.
45
46 ## Examples
47
48 <div class="panel panel-success">
49 <div class="panel-heading">**Example:** two servers defined in a rule</div>
50 <div class="panel-body">
51 ````ini
52 [rule]
53 servers = ( "server1", "server2" )
54 ````
55 </div>
56 </div>
57
58 <div class="panel panel-success">
59 <div class="panel-heading">**Example:** only one server</div>
60 <div class="panel-body">
61 ````ini
62 [rule]
63 servers = "only-one-server"
64 ````
65 </div>
66 </div>
67
68 <div class="alert alert-info" role="alert">
69 **Note:** spaces are completely optional.
70 </div>
71
72 [ini]: https://en.wikipedia.org/wiki/INI_file