zonyitoo / rust-ini

INI file parser in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom formatter

Odonno opened this issue · comments

First of, thank you for this library. It really works like a charm.

I used this library to retrieve and store data for a .Xrc file. Kind of like you may have seen a .npmrc with npm.
My concern is that the output formatting I expect is a little different than the current output from this lib.

I would like to go from this:

[section]
key=value

To this:

[section]
    key = "value"

Notice the subtle differences:

  • The value has double-quotes around it
  • Each key-value pair inside a section is indented
  • The spaces between "=" and key/value
commented

The space around = is already added by #93 . So we may need an indentation configuration in WriteOption.

I am busy these days, feel free to open a PR if you will. :)