pub fn retrieve_config_file_path() -> StringExpand description
Retrieves the configuration file path from CLI arguments or returns the default.
This function parses command-line arguments and returns the path to the INI configuration file.
If no --config-ini argument is provided, returns the default path.
§Default Path
~/.config/rusty-commit-saver/rusty-commit-saver.ini
§Returns
A String containing the absolute path to the configuration file.
§CLI Usage
// Use default config
$ rusty-commit-saver
// Returns: ~/.config/rusty-commit-saver/rusty-commit-saver.ini
// Use custom config
$ rusty-commit-saver --config-ini /custom/path/config.ini
// Returns: /custom/path/config.ini§Panics
Panics if:
- The resolved configuration file does not exist on the filesystem
- The file cannot be read (permission denied, IO error)
- The file path cannot be converted to a valid string
§Examples
ⓘ
use rusty_commit_saver::config::retrieve_config_file_path;
let config_path = retrieve_config_file_path();
println!("Using config: {}", config_path);§See Also
get_or_default_config_ini_path- Helper that implements the CLI parsing logicget_default_ini_path- Constructs the default configuration path