#ini #configuration #merge

ini-merge

Library to merge ini files subject to configuration

15 unstable releases (3 breaking)

0.4.1 Feb 12, 2024
0.3.5 Dec 26, 2023
0.3.4 Nov 17, 2023
0.2.1 Jul 31, 2023

#372 in Configuration

Download history 243/week @ 2023-11-02 73/week @ 2023-11-09 137/week @ 2023-11-16 221/week @ 2023-11-23 550/week @ 2023-11-30 96/week @ 2023-12-07 342/week @ 2023-12-14 357/week @ 2023-12-21 422/week @ 2023-12-28 376/week @ 2024-01-04 301/week @ 2024-01-11 278/week @ 2024-01-18 651/week @ 2024-01-25 311/week @ 2024-02-01 616/week @ 2024-02-08 542/week @ 2024-02-15

2,120 downloads per month
Used in chezmoi_modify_manager

LGPL-3.0-only

59KB
1.5K SLoC

Library to merge INI files subject to configuration

[ crates.io ] [ lib.rs ] [ docs.rs ]

This library forms the backend to chezmoi_modify_manager. You probably want that tool instead.

This library provides processing of INI files. In particular:

  • Merging of a source INI file with a target INI file. The merging is asymmetric: The values of the source are preferred unless specific rules have been provided for those sections and/or keys. Formatting is preserved. See [merge_ini].
  • Filtering of an INI file based on a rule set

The use case of this is configuration management for user settings file where the program writes a mix of settings and state to the same file. This gets messy if we want to track the settings part in git using a tool like chezmoi.

A typical example of this is KDE settings files. These contain (apart from settings) state like recently opened files and positions of windows and dialog boxes. Other programs (such as PrusaSlicer) also do the same thing.

This library can be used as a backend to implement a tool to smartly merge such INI files. Such a tool is already available: chezmoi_modify_manager.

MSRV

Current minimum supported Rust version is 1.74.0. This may be updated as needed. MSRV bump is not considered a semver breaking change.

Dependencies

~4–14MB
~148K SLoC