Displaying 3 results from an estimated 3 matches for "parse_xxx".
2017 Oct 16
2
Re: [PATCH v2 1/2] daemon: add split_key_value_strings helper
...e here. (Of course whether writers of
/etc/os-release are doing the right thing is another issue. I guess
there is no validation).
> +let split_key_value_strings ?unquote lines =
Can we call this function something like ‘parse_key_value_file’? Most
of our other parsing functions are called ‘parse_xxx’, where as
‘*split*’ functions are generally reserved for functions that split a
single string.
Rich.
> + let lines = List.filter ((<>) "") lines in
> + let lines = List.filter (fun s -> s.[0] <> '#') lines in
> + let lines = List.map (String.split &qu...
2017 Oct 16
0
Re: [PATCH v2 1/2] daemon: add split_key_value_strings helper
...nd any
standard documentation for its format, and the examples I have have
either no quoting, or double quoting.
> > +let split_key_value_strings ?unquote lines =
>
> Can we call this function something like ‘parse_key_value_file’? Most
> of our other parsing functions are called ‘parse_xxx’, where as
> ‘*split*’ functions are generally reserved for functions that split a
> single string.
OK, I will rename it to parse_key_value_strings (since the "_file"
suffix would imply it parses a file, while it just acts on strings).
Thanks,
--
Pino Toscano
2017 Oct 16
3
[PATCH v2 0/2] daemon: add and use split_key_value_strings helper
Changes from v1 to v2:
- split the "simple unquoting" as helper
- pass the unquoting function to split_key_value_strings
- use right unquoting function when applying split_key_value_strings
Pino Toscano (2):
daemon: add split_key_value_strings helper
daemon: use split_key_value_strings
daemon/inspect_fs_unix.ml | 93 +++++++++++++++++++----------------------------
daemon/md.ml