pub fn resolve_privilege_tool(
mode: PrivilegeMode,
) -> Result<PrivilegeTool, String>Expand description
What: Resolve which privilege tool to use based on the configured mode.
Inputs:
mode: User-configuredPrivilegeMode.
Output: Ok(tool) on success, Err with actionable message on failure.
ยงErrors
Auto: neither doas nor sudo found on$PATH.Sudo/Doas: the explicitly requested tool is not on$PATH.
Details:
Autoprefers doas over sudo when both are available.- Explicit modes fail fast with a message suggesting config changes.