Skip to main content

password_from_args

Function password_from_args 

Source
fn password_from_args(
    password: Option<&str>,
    passwordfile: Option<&str>,
    passwordenv: Option<&str>,
) -> Result<Option<String>>
Expand description

Non-interactive half of resolve_password, split out so the precedence is unit-testable.

Order (legacy handlePasswordAuth): --password, then --passwordfile, then --passwordenv. An empty --password "" falls through, and --passwordfile short-circuits --passwordenv even when the file’s first line is empty — both match legacy’s else if chain.