option_parser: Support having "=" inside option values

This is particularly helpful as the cloud-init DMI serial number
encoding scheme uses "=" and ";" for key value pairs.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2022-04-21 12:13:11 +01:00 committed by Sebastien Boeuf
parent 4a04d1f8f2
commit 6ccf037972

View File

@ -77,7 +77,7 @@ impl OptionParser {
}
for option in split_commas_outside_brackets(input)?.iter() {
let parts: Vec<&str> = option.split('=').collect();
let parts: Vec<&str> = option.splitn(2, '=').collect();
match self.options.get_mut(parts[0]) {
None => return Err(OptionParserError::UnknownOption(parts[0].to_owned())),