Skip to main content

split_quoted_args

Function split_quoted_args 

Source
pub fn split_quoted_args(args: &str) -> Result<Vec<String>, char>
Expand description

Splits a shell-like argument string into argv parts without invoking a shell.

This supports whitespace separation, single and double quotes, and backslash escaping. It is intentionally smaller than a shell parser: expansions, redirection, pipelines, and command separators are treated as plain argument text by callers.

Returns Err(quote_char) when the input contains an unterminated quote.