Skip to main content

expand_command_alias

Function expand_command_alias 

Source
pub fn expand_command_alias(
    line: &str,
    aliases: &HashMap<String, String>,
) -> String
Expand description

Pure: expand a typed command line through the operator’s alias map. If the first whitespace-separated token matches a key, swap it for the alias’s expansion and keep any remaining args (appended after the expansion). Single-level only — the expanded line is NOT re-checked for further aliases, so alias.x = "x ..." is safe (degenerates to “x …” dispatched once). Non-alias lines pass through unchanged.

Owned String return so the caller can borrow .as_str() without lifetime gymnastics around the input slice.