Skip to main content

parse_params

Function parse_params 

Source
pub fn parse_params(args: &[String]) -> HashMap<String, String>
Expand description

Parse key=value pairs from command line args.

Quote handling (SRD 71): if the whole arg or just the value portion is wrapped in matching '…' / "…" quotes, those quotes are stripped. So cursor=0..53%, cursor='0..53%', cursor="0..53%", 'cursor=0..53%', and "cursor=0..53%" all parse to the same (name="cursor", value="0..53%") pair. The first = still splits name from value, so values containing = retain everything after the first split.