summaryrefslogtreecommitdiff
path: root/doc/s6-frontend-config-preprocess.html
blob: 50a3bfca0bda30e39f20cad63920b5c462efbff9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="Content-Language" content="en" />
    <title>s6-frontend: the s6-frontend-config-preprocess program</title>
    <meta name="Description" content="s6-frontend: the s6-frontend-config-preprocess program" />
    <meta name="Keywords" content="s6-frontend command s6 configuration unit file s6-frontend-config preprocess preprocessor" />
    <!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> -->
  </head>
<body>

<p>
<a href="index.html">s6-frontend</a><br />
<a href="//skarnet.org/software/">Software</a><br />
<a href="//skarnet.org/">skarnet.org</a>
</p>

<h1> The s6-frontend-config-preprocess program </h1>

<p>
 <tt>s6-frontend-config-preprocess</tt> reads a s6-frontend configuration
file and executes all its inclusion directives, also preprocessing the
included files. It streams the result to stdout, which is a complete
configuration file without inclusions.
</p>

<h2> Interface </h2>

<pre>
     s6-frontend-config-preprocess <em>file</em>
</pre>

<p>
 <tt>s6-frontend-config-preprocess</tt> reads <em>file</em> and prints it
to stdout. It removes lines starting with <tt>!!</tt>.
</p>

<p>
 When it finds a <tt>!include</tt> or <tt>!includeonce</tt> directive
in <em>file</em>, it replaces it with the contents of the included
file - recursively preprocessed.
</p>

<p>
 When it finds a <tt>!includedir</tt> or <tt>!includedironce</tt>
directive in <em>file</em>, it replaces it with the recursively
preprocessed contents of every file present in the included
directory. The files are sorted alphabetically according to the
C locale.
</p>

<p>
 <tt>!includeonce</tt> and <tt>!includedironce</tt> only print
a file (resp. a directory) the first time they encounter it, and
silently ignore subsequent instances. <tt>!include</tt> and
<tt>!includedir</tt> directives will happily include the same
files several times.
</p>

<p>
 To avoid loops, a nesting limit exists. <tt>s6-frontend-config-preprocess</tt>
will fail if there are too many nested inclusions.
</p>

<h2> Exit codes </h2>

<ul>
 <li> 0: success </li>
 <li> 1: syntax error in a configuration file </li>
 <li> 2: other error in a configuration file </li>
 <li> 3: too many nested inclusions </li>
 <li> 100: usage error </li>
 <li> 111: system call failed </li>
</ul>

<h2> Notes </h2>

<ul>
 <li> <tt>s6-frontend-config-preprocess</tt> is not meant to be
called directly by the user. It is normally invoked by
<a href="s6-frontend-config-parse.html">s6-frontend-config-parse</a>.
However, the binary is made available for debugging purposes. </li>
</ul>

</body>
</html>