Skip to main content

parse_echo_args

Function parse_echo_args 

Source
pub fn parse_echo_args(args: &[String]) -> (EchoConfig, &[String])
Expand description

Parse the raw command-line arguments (after the program name) into an EchoConfig and the remaining text arguments.

GNU echo uses manual flag parsing: a leading argument is only treated as flags if it starts with - and every subsequent character is one of n, e, or E. Combined flags like -neE are valid. Anything else (e.g. -z, --foo, or even -) is treated as a normal text argument.