Elektra
0.8.19
|
See the validation tutorial for introduction. This plugin provides a conceptual simplistic specification language.
It currently supports to specify:
*
)The plugin demonstrates how simple a configuration specification can be within the Elektra framework. It is conceptual and mainly for educational usage. You can base your plugins
/keyword/enum
, default enum
: used as keywords for enum definitions./keyword/assign
, default =
: used as keywords for assignment.Configuration within the specification language:
mountpoint <filename>
: defines a file-name for kdb spec-mount
plugins <pluginspec>
: defines list of plugins for kdb spec-mount
First you need to mount the plugin to spec, e.g.:
kdb mount myspec.ssl spec/test simplespeclang
Then you can write your specification (with default keywords):
cat << HERE > `kdb file spec/test` mountpoint filename.txt enum key = value1 value2 value3 enum key2 = value1 value2 HERE
And finally you need a specification mount, so that all necessary plugins are present:
kdb spec-mount /test
Also make sure that spec
is mounted as global plugin:
kdb global-mount
Then you are only able to write valid keys:
kdb set /test/key value1 # accepted kdb set /test/key2 value3 # rejected, no value3 for key2 kdb set /test/something else # rejected, no key something