mirror of
https://github.com/moudey/Shell.git
synced 2026-11-16 09:04:25 +08:00
78 lines
2.5 KiB
HTML
78 lines
2.5 KiB
HTML
<h4>Syntax Rules for Configuration Files</h4>
|
|
<br>
|
|
<p>This chapter describes the syntax rules for configuration file.</p>
|
|
<ul>
|
|
<li>Syntax are not case sensitive.</li>
|
|
<li>Spaces around the equal (<code>=</code>) sign are optional and are ignored.</li>
|
|
<li>The properties of static and dynamic items are separated by blank spaces or on a separate line and must be placed in parentheses <code>( )</code>.</li>
|
|
<li>variable are optional.</li>
|
|
<li>default are optional.</li>
|
|
<li>Static items are optional.</li>
|
|
<li>Static items have one type: item.</li>
|
|
<li>Dynamic items are optional.</li>
|
|
<li>Dynamic items have three types: menu, item, and separator(sep).</li>
|
|
</ul>
|
|
<p><i>Tip:</i> When there is an error, it is recorded in the log file (shell.log).</p>
|
|
|
|
<p>The following rules apply to the syntax of configuration file (shell.shl):</p>
|
|
<h5>shell.shl structure</h5>
|
|
<pre class="syntax"><code>shell
|
|
{
|
|
<span class="syntax-comment">// global variables</span>
|
|
var
|
|
{
|
|
<span class="syntax-comment">// variables content</span>
|
|
variable-name = variable-value
|
|
...
|
|
}
|
|
|
|
default
|
|
{
|
|
<span class="syntax-comment">// defaults content</span>
|
|
default-name = default-value
|
|
default-name = [default-value, default-value, ...]
|
|
...
|
|
}
|
|
|
|
<span class="syntax-comment">// static items</span>
|
|
static
|
|
{
|
|
<span class="syntax-comment">// static items content</span>
|
|
item ( property-name = property-value ... )
|
|
...
|
|
}
|
|
|
|
<span class="syntax-comment">// dynamic items</span>
|
|
dynamic
|
|
{
|
|
<span class="syntax-comment">// dynamic items content</span>
|
|
item ( property-name = property-value ... )
|
|
|
|
separator [( property-name = property-value ... )]
|
|
|
|
menu ( property-name = property-value ... )
|
|
{
|
|
var <span class="syntax-comment">// local variables</span>
|
|
{
|
|
variable-name = variable-value
|
|
...
|
|
}
|
|
|
|
item ( property-name = property-value ... )
|
|
...
|
|
}
|
|
...
|
|
}
|
|
}</code></pre>
|
|
|
|
<br>
|
|
<p><b>Breaking Long Lines</b><br>For best readability, users often like to avoid lines longer than 80 characters. single quotes also allow break up a line.</p>
|
|
<pre class="syntax"><code>shell
|
|
{
|
|
dynamic
|
|
{
|
|
item(title=<span class="syntax-string">'Command prompt'</span>
|
|
cmd=<span class="syntax-string">'cmd.exe'</span>)
|
|
}
|
|
}</code></pre>
|