Skip to main content

resolve_driver_binary

Function resolve_driver_binary 

Source
pub fn resolve_driver_binary(driver: &str, cli_alias: Option<&str>) -> String
Expand description

Resolve the binary name for a given driver name.

F2: takes an explicit cli_alias parameter (from --cli flag) instead of reading only the process-global CLI env var. Precedence (mirrors driver-claude-code.sh binary resolution):

  1. $CLAUDE_CLI env var (explicit override)
  2. cli_alias (from --cli flag, placed in child env as CLI)
  3. $CLI env var (legacy path)
  4. "claude" default

Passing cli_alias explicitly avoids set_var (process-global mutation that is a footgun in tests). The child env receives CLI=<alias> via the static env list; this function reflects that same value without touching the parent process environment.