
\begin{DoxyItemize}
\item infos = Information about the mini plugin is in keys below
\item infos/author = René Schwaiger \href{mailto:sanssecours@me.com}{\tt sanssecours@me.\+com}
\item infos/licence = B\+SD
\item infos/needs = ccode
\item infos/provides = storage/ini
\item infos/recommends =
\item infos/placements = getstorage setstorage
\item infos/status = maintained shelltest unittest nodep limited
\item infos/metadata =
\item infos/description = A minimal plugin for simple I\+NI files
\end{DoxyItemize}\hypertarget{autotoc_md407_src_plugins_mini_README_md}{}\section{m\+I\+NI}\label{autotoc_md407_src_plugins_mini_README_md}
The “maybe this is not I\+N\+I” plugin ({\ttfamily mini}) is a very simple storage plugin loosely based on the \href{https://en.wikipedia.org/wiki/INI_file}{\tt I\+NI} 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}{\tt .properties} format, used in many Java applications.\hypertarget{autotoc_md407_autotoc_md408}{}\subsection{Examples}\label{autotoc_md407_autotoc_md408}
\hypertarget{autotoc_md407_autotoc_md409}{}\subsubsection{Basic Usage}\label{autotoc_md407_autotoc_md409}
The following example shows basic usage of the {\ttfamily mini} plugin.

``{\ttfamily  @section autotoc\+\_\+md410 Mount mini plugin to}user/tests/mini` sudo kdb mount mini.\+ini user/tests/mini mini\hypertarget{autotoc_md407_autotoc_md411}{}\section{Add two key value pairs to the database}\label{autotoc_md407_autotoc_md411}
kdb set user/tests/mini/key value \#$>$ Create a new key user/tests/mini/key with string \char`\"{}value\char`\"{} kdb set user/tests/mini/mi/mi/mr beaker \#$>$ Create a new key user/tests/mini/mi/mi/mr with string \char`\"{}beaker\char`\"{}\hypertarget{autotoc_md407_autotoc_md412}{}\section{Export our current configuration}\label{autotoc_md407_autotoc_md412}
kdb export user/tests/mini mini \#$>$ key=value \#$>$ mi/mi/mr=beaker\hypertarget{autotoc_md407_autotoc_md413}{}\section{Manually add some values}\label{autotoc_md407_autotoc_md413}
echo \char`\"{}🔑 = 🦄\char`\"{} $>$$>$ {\ttfamily kdb file user/tests/mini} echo \char`\"{}level1/level2 = 👾\char`\"{} $>$$>$ {\ttfamily kdb file user/tests/mini}\hypertarget{autotoc_md407_autotoc_md414}{}\section{Now `user/tests/mini` contains four key value pairs}\label{autotoc_md407_autotoc_md414}
kdb ls user/tests/mini \#$>$ user/tests/mini/key \#$>$ user/tests/mini/level1/level2 \#$>$ user/tests/mini/mi/mi/mr \#$>$ user/tests/mini/🔑\hypertarget{autotoc_md407_autotoc_md415}{}\section{Let us check if `user/tests/mini/🔑` contains the correct value}\label{autotoc_md407_autotoc_md415}
kdb get \char`\"{}user/tests/mini/🔑\char`\"{} \#$>$ 🦄\hypertarget{autotoc_md407_autotoc_md416}{}\section{Undo modifications to the key database}\label{autotoc_md407_autotoc_md416}
kdb rm -\/r user/tests/mini sudo kdb umount user/tests/mini 
\begin{DoxyCode}
### Escaping

As with most configuration file formats, some characters carry special meaning. In the case of the `mini`
       plugin that character are

1. the `=` sign, which separates keys from values and
2. `#` and `;`, the characters that denote a comment.

In case of **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 mINI use the backslash
       character (`\(\backslash\)`) to escape values, the backspace character will be escaped too (`\(\backslash\)\(\backslash\)`). The following example shows
       the escaping behavior.
\end{DoxyCode}
 sudo kdb mount mini.\+ini user/tests/mini mini\hypertarget{autotoc_md407_autotoc_md417}{}\section{Store a value containing special characters}\label{autotoc_md407_autotoc_md417}
kdb set user/tests/mini/key \textquotesingle{};\#=\textbackslash{}\textquotesingle{} \#$>$ Create a new key user/tests/mini/key with string \char`\"{};\#=\textbackslash{}\char`\"{}\hypertarget{autotoc_md407_autotoc_md418}{}\section{The actual file contains escaped version of the characters}\label{autotoc_md407_autotoc_md418}
kdb file user/tests/mini $\vert$ xargs cat \#$>$ key=\textbackslash{};\#\textbackslash{}=\textbackslash{}\hypertarget{autotoc_md407_autotoc_md419}{}\section{However, if you retrieve the value you do not have to care}\label{autotoc_md407_autotoc_md419}
\hypertarget{autotoc_md407_autotoc_md420}{}\section{about the escaped characters}\label{autotoc_md407_autotoc_md420}
kdb get user/tests/mini/key \#$>$ ;\#=\textbackslash{}\hypertarget{autotoc_md407_autotoc_md421}{}\section{If we do not escape the `;` and `\#` characters, then they}\label{autotoc_md407_autotoc_md421}
\hypertarget{autotoc_md407_autotoc_md422}{}\section{donate a comment.}\label{autotoc_md407_autotoc_md422}
echo \textquotesingle{}background = \#0\+F0\+F0F ; Background color\textquotesingle{} $>$$>$ {\ttfamily kdb file user/tests/mini} echo \textquotesingle{}foreground = \#F\+F\+F\+F\+FF \# Foreground color\textquotesingle{} $>$$>$ {\ttfamily kdb file user/tests/mini} kdb get user/tests/mini/background \#$>$ \#0\+F0\+F0F kdb get user/tests/mini/foreground \#$>$ \#\+F\+F\+F\+F\+FF\hypertarget{autotoc_md407_autotoc_md423}{}\section{Undo modifications to the key database}\label{autotoc_md407_autotoc_md423}
kdb rm -\/r user/tests/mini sudo kdb umount user/tests/mini 
\begin{DoxyCode}
In the case of **key names** you **must not use any of the characters mentioned above** (`;`, `#` and `=`)
       at all. Otherwise the behavior of the plugin will be **undefined**.

## Limitations

This plugin only supports simple key-value based properties files without sections. mINI also does not
       support metadata. If you want a more feature complete plugin, then please take a look at the [ini plugin](@ref
       src\_plugins\_ini\_README\_md). The example below shows some of the limitations of the plugin.
\end{DoxyCode}
 sudo kdb mount mini.\+ini user/tests/mini mini\hypertarget{autotoc_md407_autotoc_md424}{}\section{The plugin does not support sections or multi-\/line values}\label{autotoc_md407_autotoc_md424}
echo \textquotesingle{}\mbox{[}section\mbox{]}\textquotesingle{} $>$$>$ {\ttfamily kdb file user/tests/mini} printf \textquotesingle{}key=\char`\"{}multi\textbackslash{}nline\char`\"{}\textquotesingle{} $>$$>$ {\ttfamily kdb file user/tests/mini}\hypertarget{autotoc_md407_autotoc_md425}{}\section{m\+I\+N\+I only reads the first line of the value with the name `key`, since}\label{autotoc_md407_autotoc_md425}
\hypertarget{autotoc_md407_autotoc_md426}{}\section{the plugin assigns no special meaning to double or single quotes.}\label{autotoc_md407_autotoc_md426}
kdb ls user/tests/mini 2$>$ stderr.\+txt \#$>$ user/tests/mini/key\hypertarget{autotoc_md407_autotoc_md427}{}\section{As we can see in the first two line of the standard error output below,}\label{autotoc_md407_autotoc_md427}
\hypertarget{autotoc_md407_autotoc_md428}{}\section{m\+I\+N\+I will inform us about lines it was unable to parse.}\label{autotoc_md407_autotoc_md428}
cat stderr.\+txt $\vert$ grep -\/oE \textquotesingle{}Line \mbox{[}\mbox{[}\+:digit\+:\mbox{]}\mbox{]}+.$\ast$\textquotesingle{} $\vert$ sed \textquotesingle{}s/$^\wedge$\mbox{[}\mbox{[}\+:space\+:\mbox{]}\mbox{]}$\ast$//\textquotesingle{} \#$>$ Line 1\+: \textquotesingle{}\mbox{[}section\mbox{]}\textquotesingle{} is not a valid key value pair \#$>$ Line 3\+: \textquotesingle{}line"\textquotesingle{} is not a valid key value pair\hypertarget{autotoc_md407_autotoc_md429}{}\section{Unlike the `ini` and `ni` plugin, m\+I\+N\+I does not support metadata.}\label{autotoc_md407_autotoc_md429}
kdb meta-\/ls user/tests/mini \hypertarget{autotoc_md407_autotoc_md430}{}\section{R\+E\+T\+: 1}\label{autotoc_md407_autotoc_md430}
\hypertarget{autotoc_md407_autotoc_md431}{}\section{The value of `key` also contains the double quote symbol, since m\+I\+N\+I does}\label{autotoc_md407_autotoc_md431}
\hypertarget{autotoc_md407_autotoc_md432}{}\section{not assign special meaning to quote characters.}\label{autotoc_md407_autotoc_md432}
kdb get user/tests/mini/key \#$>$ "multi\hypertarget{autotoc_md407_autotoc_md433}{}\section{Undo modifications}\label{autotoc_md407_autotoc_md433}
rm stderr.\+txt kdb rm -\/r user/tests/mini sudo kdb umount user/tests/mini ``` 