
\begin{DoxyItemize}
\item infos = Information about the mini plugin is in keys below
\item infos/author = René Schwaiger \href{mailto:sanssecours@me.com}{\texttt{ sanssecours@me.\+com}}
\item infos/licence = BSD
\item infos/needs = ccode
\item infos/provides = storage/properties
\item infos/recommends =
\item infos/placements = getstorage setstorage
\item infos/status = shelltest unittest nodep limited
\item infos/metadata =
\item infos/description = A minimal plugin for properties files
\end{DoxyItemize}\hypertarget{md_src_plugins_mini_README_src_plugins_mini_README_md}{}\doxysection{m\+INI}\label{md_src_plugins_mini_README_src_plugins_mini_README_md}
The “maybe this is not INI” plugin ({\ttfamily mini}) is a very simple storage plugin loosely based on the \href{https://en.wikipedia.org/wiki/INI_file}{\texttt{ INI}} file format. Since this plugin {\bfseries{does not support sections}} it might be more appropriate to say that it is based on the \href{https://en.wikipedia.org/wiki/.properties}{\texttt{ .properties}} format, used in many Java applications.\hypertarget{md_src_plugins_mini_README_autotoc_md342}{}\doxysubsection{Examples}\label{md_src_plugins_mini_README_autotoc_md342}
\hypertarget{md_src_plugins_mini_README_autotoc_md343}{}\doxysubsubsection{Basic Usage}\label{md_src_plugins_mini_README_autotoc_md343}
The following example shows basic usage of the {\ttfamily mini} plugin.


\begin{DoxyCode}{0}
\DoxyCodeLine{\# Mount mini plugin to `user:/tests/mini`}
\DoxyCodeLine{sudo kdb mount mini.ini user:/tests/mini mini}
\DoxyCodeLine{}
\DoxyCodeLine{\# Add two key value pairs to the database}
\DoxyCodeLine{kdb set user:/tests/mini/key value}
\DoxyCodeLine{\#> Create a new key user:/tests/mini/key with string "{}value"{}}
\DoxyCodeLine{kdb set user:/tests/mini/mi/mi/mr beaker}
\DoxyCodeLine{\#> Create a new key user:/tests/mini/mi/mi/mr with string "{}beaker"{}}
\DoxyCodeLine{}
\DoxyCodeLine{\# Export our current configuration}
\DoxyCodeLine{kdb export user:/tests/mini mini}
\DoxyCodeLine{\#> key=value}
\DoxyCodeLine{\#> mi/mi/mr=beaker}
\DoxyCodeLine{}
\DoxyCodeLine{\# Manually add some values}
\DoxyCodeLine{echo "{}🔑 = 🦄"{}           >> `kdb file user:/tests/mini`}
\DoxyCodeLine{echo "{}level1/level2 = 👾"{} >> `kdb file user:/tests/mini`}
\DoxyCodeLine{}
\DoxyCodeLine{\# Now `user:/tests/mini` contains four key value pairs}
\DoxyCodeLine{kdb ls user:/tests/mini}
\DoxyCodeLine{\#> user:/tests/mini/key}
\DoxyCodeLine{\#> user:/tests/mini/level1/level2}
\DoxyCodeLine{\#> user:/tests/mini/mi/mi/mr}
\DoxyCodeLine{\#> user:/tests/mini/🔑}
\DoxyCodeLine{}
\DoxyCodeLine{\# Let us check if `user:/tests/mini/🔑` contains the correct value}
\DoxyCodeLine{kdb get "{}user:/tests/mini/🔑"{}}
\DoxyCodeLine{\#> 🦄}
\DoxyCodeLine{}
\DoxyCodeLine{\# Undo modifications to the key database}
\DoxyCodeLine{kdb rm -\/r user:/tests/mini}
\DoxyCodeLine{sudo kdb umount user:/tests/mini}

\end{DoxyCode}
\hypertarget{md_src_plugins_mini_README_autotoc_md344}{}\doxysubsubsection{Escaping}\label{md_src_plugins_mini_README_autotoc_md344}
As with most configuration file formats, some characters carry special meaning. In the case of the {\ttfamily mini} plugin that character are


\begin{DoxyEnumerate}
\item the {\ttfamily =} sign, which separates keys from values and
\item {\ttfamily \#} and {\ttfamily ;}, the characters that denote a comment.
\end{DoxyEnumerate}

In case of {\bfseries{key values}} you do not need to care about the special meaning of these characters most of the time, since the plugin handles escaping and unescaping of them for you. Since m\+INI use the backslash character ({\ttfamily \textbackslash{}}) to escape values, the backspace character will be escaped too ({\ttfamily \textbackslash{}\textbackslash{}}). The following example shows the escaping behavior.


\begin{DoxyCode}{0}
\DoxyCodeLine{sudo kdb mount mini.ini user:/tests/mini mini}
\DoxyCodeLine{}
\DoxyCodeLine{\# Store a value containing special characters}
\DoxyCodeLine{kdb set user:/tests/mini/key ';\#=\(\backslash\)'}
\DoxyCodeLine{\#> Create a new key user:/tests/mini/key with string "{};\#=\(\backslash\)"{}}
\DoxyCodeLine{}
\DoxyCodeLine{\# The actual file contains escaped version of the characters}
\DoxyCodeLine{kdb file user:/tests/mini | xargs cat}
\DoxyCodeLine{\#> key=\(\backslash\);\(\backslash\)\#\(\backslash\)=\(\backslash\)\(\backslash\)}
\DoxyCodeLine{}
\DoxyCodeLine{\# However, if you retrieve the value you do not have to care}
\DoxyCodeLine{\# about the escaped characters}
\DoxyCodeLine{kdb get user:/tests/mini/key}
\DoxyCodeLine{\#> ;\#=\(\backslash\)}
\DoxyCodeLine{}
\DoxyCodeLine{\# If we do not escape the `;` and `\#` characters, then they}
\DoxyCodeLine{\# donate a comment.}
\DoxyCodeLine{echo 'background = \(\backslash\)\#0F0F0F ; Background color' >> `kdb file user:/tests/mini`}
\DoxyCodeLine{echo 'foreground = \(\backslash\)\#FFFFFF \# Foreground color' >> `kdb file user:/tests/mini`}
\DoxyCodeLine{kdb get user:/tests/mini/background}
\DoxyCodeLine{\#> \#0F0F0F}
\DoxyCodeLine{kdb get user:/tests/mini/foreground}
\DoxyCodeLine{\#> \#FFFFFF}
\DoxyCodeLine{}
\DoxyCodeLine{\# Undo modifications to the key database}
\DoxyCodeLine{kdb rm -\/r user:/tests/mini}
\DoxyCodeLine{sudo kdb umount user:/tests/mini}

\end{DoxyCode}


In the case of {\bfseries{key names}} you {\bfseries{must not use any of the characters mentioned above}} ({\ttfamily ;}, {\ttfamily \#} and {\ttfamily =}) at all. Otherwise the behavior of the plugin will be {\bfseries{undefined}}.\hypertarget{md_src_plugins_mini_README_autotoc_md345}{}\doxysubsection{Limitations}\label{md_src_plugins_mini_README_autotoc_md345}
This plugin only supports simple key-\/value based properties files without sections. m\+INI also does not support metadata. If you want a more feature complete plugin, then please take a look at the toml plugin. The example below shows some of the limitations of the plugin.


\begin{DoxyCode}{0}
\DoxyCodeLine{sudo kdb mount mini.ini user:/tests/mini mini}
\DoxyCodeLine{}
\DoxyCodeLine{\# The plugin does not support sections or multi-\/line values}
\DoxyCodeLine{echo   '[section]'         >> `kdb file user:/tests/mini`}
\DoxyCodeLine{printf 'key="{}multi\(\backslash\)nline"{}' >> `kdb file user:/tests/mini`}
\DoxyCodeLine{}
\DoxyCodeLine{\# mINI only reads the first line of the value with the name `key`, since}
\DoxyCodeLine{\# the plugin assigns no special meaning to double or single quotes.}
\DoxyCodeLine{kdb ls user:/tests/mini 2> stderr.txt}
\DoxyCodeLine{\#> user:/tests/mini/key}
\DoxyCodeLine{}
\DoxyCodeLine{\# As we can see in the first two line of the standard error output below,}
\DoxyCodeLine{\# mINI will inform us about lines it was unable to parse.}
\DoxyCodeLine{cat stderr.txt | grep -\/oE 'Line [[:digit:]]+.*' | sed 's/\string^[[:space:]]*//'}
\DoxyCodeLine{\#> Line 1: '[section]' is not a valid key value pair}
\DoxyCodeLine{\#> Line 3: 'line"{}' is not a valid key value pair}
\DoxyCodeLine{}
\DoxyCodeLine{\# Unlike the `ini` and `ni` plugin, mINI does not support metadata.}
\DoxyCodeLine{kdb meta-\/ls user:/tests/mini}
\DoxyCodeLine{\# RET: 1}
\DoxyCodeLine{}
\DoxyCodeLine{\# The value of `key` also contains the double quote symbol, since mINI does}
\DoxyCodeLine{\# not assign special meaning to quote characters.}
\DoxyCodeLine{kdb get user:/tests/mini/key}
\DoxyCodeLine{\#> "{}multi}
\DoxyCodeLine{}
\DoxyCodeLine{\# Undo modifications}
\DoxyCodeLine{rm stderr.txt}
\DoxyCodeLine{kdb rm -\/r user:/tests/mini}
\DoxyCodeLine{sudo kdb umount user:/tests/mini}

\end{DoxyCode}
 