Function get_ini_file

Source
pub fn get_ini_file() -> Ini
Expand description

Loads and parses the INI configuration file from disk.

Reads the configuration file (from CLI argument or default location), parses its contents using parse_ini_content(), and returns the parsed Ini object.

§Returns

A parsed Ini configuration object

§Panics

Panics if:

  • The configuration file doesn’t exist at the resolved path
  • The file cannot be read (permission denied, I/O error)
  • The file content is not valid UTF-8
  • The INI syntax is invalid (malformed sections or key-value pairs)

§File Resolution Order

  1. Check for --config-ini <PATH> CLI argument
  2. Fall back to ~/.config/rusty-commit-saver/rusty-commit-saver.ini

§Expected INI Structure

[obsidian]
root_path_dir = ~/Documents/Obsidian
commit_path = Diaries/Commits

[templates]
commit_date_path = %Y/%m-%B/%F.md
commit_datetime = %Y-%m-%d %H:%M:%S

§Called By

This function is called internally by GlobalVars::set_all().

§See Also