1
0
mirror of https://github.com/emersion/kanshi synced 2024-11-23 00:02:16 +01:00

store: allow * to match any output name

Fixes #9
This commit is contained in:
emersion 2018-11-04 08:35:43 +01:00
parent b707965878
commit a3eccd20ae
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

@ -233,10 +233,21 @@ fn parse_configuration_with_args(args: Vec<ConfigurationArg>) -> SavedConfigurat
c
}
named!(parse_output_name<&[u8], String>, map!(
parse_string,
|s| {
if s == "*" {
String::from("")
} else {
s
}
}
));
named!(parse_output<&[u8], ConfigurationArg>, do_parse!(
tag!("output")
>> parse_space
>> name: parse_string
>> name: parse_output_name
>> args: many0!(preceded!(parse_space, parse_output_arg))
>> (ConfigurationArg::Output(parse_output_with_args(name, args)))
));