Elektra  0.9.5
Plugin: kconfig

This plugin can be used to parse and serialize a KConfig INI file.

Information about the syntax:

An example of how a valid config file might look like:

[group][subgroup]
key.name[en][$i][$e]=Key Value
key.name[de]=Key Wert

And how it will be represented in kdb:

keyNew (PREFIX "group/subgroup/key.name[en]", KEY_VALUE, "Key Value", KEY_META, "kconfig", "ie", KEY_END)
keyNew (PREFIX "group/subgroup/key.name[de]", KEY_VALUE, "Key Wert", KEY_END)

The following example shows you how you can read data using this plugin.

`` @section autotoc_md324 Mount the plugin to the cascading namespace/tests/kconfig` sudo kdb mount configrc /tests/kconfig kconfig

Manually add a key-value pair to the database

mkdir -p "$(dirname "$(kdb file /tests/kconfig)")" echo 'key=Value' > "$(kdb file /tests/kconfig)"

Retrieve the new value

kdb get /tests/kconfig/key #> Value

Set the value to Example

kdb set /tests/kconfig/key Example

Verify that the value has changed in the file too

cat kdb file /tests/kconfig #> key=Example

Manually add a gorup to the database

echo '[group][subgroup]' >> "$(kdb file /tests/kconfig)"

Manually add a key that contains metas to that group

echo 'key.name[$a][$i]=New Value' >> "$(kdb file /tests/kconfig)"

Retrieve the new value

kdb get /tests/kconfig/group/subgroup/key.name #> New Value

Retrieve the meta values

kdb meta-get /tests/kconfig/group/subgroup/key.name kconfig #> ai

Manually add a group and a localized key

echo '[localized keys]' >> kdb file /tests/kconfig echo 'greeting[en]=Hello' >> kdb file /tests/kconfig echo 'greeting[de]=Hallo' >> kdb file /tests/kconfig

Retrieve the english greeting

kdb get '/tests/kconfig/localized keys/greeting[en]' #> Hello

Retrieve the german greeting

kdb get '/tests/kconfig/localized keys/greeting[de]' #> Hallo

Undo modifications to the database

sudo kdb umount /tests/kconfig ```

Limitations