Skip to main content

command_line

Function command_line 

Source
pub fn command_line(input: &BStr) -> Result<Outcome, Error>
Expand description

Split input into leading environment assignments and the command with its arguments.

Whitespace, quotes, escapes, line continuations, and comments follow POSIX shell word-splitting rules. Shell expansions and operators are not interpreted. An assignment is recognized only when its name is an unquoted shell identifier. Assignment-only input is rejected because it contains no command to execute. Environment assignment names are strings, while their values, the command, and arguments are converted losslessly to OS strings or rejected if the platform cannot represent them.