get_cli_config_file_path

Function get_cli_config_file_path 

Source
pub fn get_cli_config_file_path() -> Result<PathBuf, MantaError>
Expand description

Returns the CLI config file path, honoring MANTA_CLI_CONFIG if set.

When the env var is present its value wins verbatim (no validation, no relative-path resolution); otherwise the XDG default (~/.config/manta/cli.toml on Linux) is returned.

§Errors

Returns MantaError::MissingField if MANTA_CLI_CONFIG is unset and the platform cannot resolve a project-dirs triple. The env-var branch is infallible.

§Examples

use manta_shared::common::config::get_cli_config_file_path;

// SAFETY: doc-tests run single-threaded.
unsafe { std::env::set_var("MANTA_CLI_CONFIG", "/etc/manta/cli.toml") };
let path = get_cli_config_file_path().unwrap();
assert_eq!(path, std::path::PathBuf::from("/etc/manta/cli.toml"));