Status : development.
KV : SP* K SP* ':' SP* V SP*
M1 : KV (',' KV)* ','? SP*
M2 : SP* '{' M1 '}' SP*
M3 : SP*
M : M2 | M1 | M3
K1 = V1 : ([^<{}:,"\s][^{}:,"\s]*)
K2 = V2 : '"' (Q | [^"\\\s])* '"'
Q : '\"' | '\\' | '\n' | '\r' | '\t' | '\v' | '\0'
K3 = V3 : '"""' \n (.*?) '"""'
K4 = V4 : '<<' D \s (.*?) D
V5 : M2
K : K1 | K2 | K3 | K4
V : V1 | V2 | V3 | V4 | V5
The parser will emit events for KV.
kv --get FILE [...] <<EOF
A, B.B1, C."C1".C2
EOF
Will output concatenated values of files for keys A, B.B1 and C.C1.C2. Keys must be quoted according to K1 or K2.
kv --quote FILE [...]
Will quote files according to (K1 | K2 | K3 | K4) whichever is best.
kv --unquote FILE [...]
Will unquote files according to (K1 | K2 | K3 | K4).
The reference implementation of kv is implemented in ANSI C.