24 unstable releases (5 breaking)

0.6.0 Sep 6, 2024
0.5.2 Aug 31, 2024
0.5.1 Jul 14, 2024
0.4.3 Mar 15, 2024
0.2.1 Jul 31, 2023

#222 in Configuration

Download history 144/week @ 2024-07-04 319/week @ 2024-07-11 202/week @ 2024-07-18 300/week @ 2024-07-25 210/week @ 2024-08-01 83/week @ 2024-08-08 223/week @ 2024-08-15 106/week @ 2024-08-22 624/week @ 2024-08-29 400/week @ 2024-09-05 194/week @ 2024-09-12 159/week @ 2024-09-19 259/week @ 2024-09-26 29/week @ 2024-10-03 100/week @ 2024-10-10 101/week @ 2024-10-17

495 downloads per month
Used in chezmoi_modify_manager

LGPL-3.0-only

65KB
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.
  • 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.75.0. This may be updated as needed. MSRV bump is not considered a semver breaking change.

Dependencies

~4–17MB
~250K SLoC