Configuration file format ========================= Common formats: 1. key=value with # comments 2. key=value with [sections] and # comments 3. toml, which is key="value", key=["value"], key=123 etc. (plus [sections] I think?) 4. yaml, which is indented and maybe not a very good idea 5. json 2 and 3 are probably the best options. for 2 we could also have data types - all data is trimmed before parsing! - string: data is parsed as is. should spanning over multiple lines with \ (and then indented) be allowed? -- how to specify a string with a trailing \ -- maybe we can quote it in that case? - multiline string: could be indented. - boolean - integer - list: a, b, c (elements can be of string, boolean or integer type) -- when a list in a string contains commas, or starts with a double quote, we could wrap it: --- "a,1", "\"b", "c\\" or, we just go with a simple variant of 2: - multi-word strings (when the following lines are indented, they are merged. blank indented lines are considered blank, i.e. ends the value) - no-space strings (like regular strings, but spaces are skipped when there are multiple lines) - multiline strings (second and following lines are indented) -- if a following line is . the it's considered blank - boolean - integer - list: a, b, c (items must be simple strings (no commas, line wrapping, etc., or booleans, or integers) -- elements are trimmed -- nested lists are not supported should we allow multi-space indentation in trimmed strings? should we enforce it? - we could require/allow 4 spaces indentation, at least for everything except multiline strings. - we could require/allow alignment with the = character Example ------- [section] key_str=value key_int=123 key_boolean=true key_wrapped_str=test continues here key_multiline_str=first second third key_int_list = 1, 2, 3 # when lists are wrapped, the line must end with a comma key_int_list_wrapped = 1, 2, 3 key_bool_list = true, false, true # lists may start with the item on the second line, and may end with a trailing comma key_bool_list_wrapped = true, false, key_str_list = a, b, c # strings may not be wrapped in lists, and may not contain commas key_str_list_wrapped = a b c d, e, # elements are trimmed key_str_trimmed = a,b , c, d, e, f ,