fix save command parsing for parameterless values

fixes #231
This commit is contained in:
Henrik Friedrichsen
2020-07-31 22:16:07 +02:00
parent 90cc4ffb65
commit 0f0c0e1383

View File

@@ -319,10 +319,13 @@ pub fn parse(input: &str) -> Option<Command> {
"focus" => args
.get(0)
.map(|target| Command::Focus((*target).to_string())),
"save" => args.get(0).map(|target| match *target {
"queue" => Command::SaveQueue,
_ => Command::Save,
}),
"save" => args
.get(0)
.map(|target| match *target {
"queue" => Command::SaveQueue,
_ => Command::Save,
})
.or(Some(Command::Save)),
"volup" => Some(Command::VolumeUp),
"voldown" => Some(Command::VolumeDown),
"help" => Some(Command::Help),