mirror of
https://github.com/moudey/Shell.git
synced 2026-11-16 09:04:25 +08:00
81 lines
2.3 KiB
HTML
81 lines
2.3 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>
|
|
|
|
<div class="notification is-info is-light">
|
|
<i>Tip:</i> When there is an error, it is recorded in the log file (shell.log).
|
|
</div>
|
|
|
|
<p>The following rules apply to the syntax of configuration file (shell.shl):</p>
|
|
<h5>shell.shl structure</h5>
|
|
<pre><code class="lang-shell">shell
|
|
{
|
|
// global variables
|
|
var // variables
|
|
{
|
|
// variables content
|
|
variable-name = variable-value
|
|
...
|
|
}
|
|
|
|
default // def or settings
|
|
{
|
|
// defaults content
|
|
default-name = default-value
|
|
default-name = [default-value, default-value, ...]
|
|
...
|
|
}
|
|
|
|
// static items
|
|
static
|
|
{
|
|
// static items content
|
|
item ( property-name = property-value ... )
|
|
...
|
|
}
|
|
|
|
// dynamic items
|
|
dynamic
|
|
{
|
|
// dynamic items content
|
|
item ( property-name = property-value ... )
|
|
|
|
separator [( property-name = property-value ... )]
|
|
|
|
menu ( property-name = property-value ... )
|
|
{
|
|
var // local variables
|
|
{
|
|
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><code class="lang-shell">shell
|
|
{
|
|
dynamic
|
|
{
|
|
item(title='Command prompt'
|
|
cmd='cmd.exe')
|
|
}
|
|
}</code></pre>
|