From 0f08a56f90dc319086bdbe05247a213280c552e9 Mon Sep 17 00:00:00 2001 From: Henry Snopek Date: Wed, 24 Jun 2020 21:53:15 -0500 Subject: [PATCH] [feat] add Command::Noop --- src/command.rs | 3 +++ src/commands.rs | 1 + 2 files changed, 4 insertions(+) diff --git a/src/command.rs b/src/command.rs index 82655a6..b4b296e 100644 --- a/src/command.rs +++ b/src/command.rs @@ -102,11 +102,13 @@ pub enum Command { Shift(ShiftMode, Option), Search(String), Help, + Noop, } impl fmt::Display for Command { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let repr = match self { + Command::Noop => "noop".to_string(), Command::Quit => "quit".to_string(), Command::TogglePlay => "playpause".to_string(), Command::Stop => "stop".to_string(), @@ -324,6 +326,7 @@ pub fn parse(input: &str) -> Option { "volup" => Some(Command::VolumeUp), "voldown" => Some(Command::VolumeDown), "help" => Some(Command::Help), + "noop" => Some(Command::Noop), _ => None, } } diff --git a/src/commands.rs b/src/commands.rs index 903cb58..f0c2283 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -83,6 +83,7 @@ impl CommandManager { cmd: &Command, ) -> Result, String> { match cmd { + Command::Noop => Ok(None), Command::Quit => { s.quit(); Ok(None)