pub fn active_tool() -> Result<PrivilegeTool, String>Expand description
What: Resolve the privilege tool using the cached application settings.
Inputs: None (reads crate::theme::settings().privilege_mode).
Output:
Ok(PrivilegeTool)for successful resolution, orOk(Sudo)afterAutofailure (see [active_tool_for_mode]).Err(String)when explicitsudoordoasmode cannot be satisfied.
Details:
- Callers should propagate or display
Errso misconfiguration is visible. - Same fallback rules as [
active_tool_for_mode].
ยงErrors
Returns Err when PrivilegeMode::Sudo or PrivilegeMode::Doas is configured but
that tool is not available on $PATH. PrivilegeMode::Auto never errors here: it falls
back to PrivilegeTool::Sudo after logging a warning.