From d75bc24bdd176786a1340e16f7aa3db6e3e6a093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Mon, 19 Oct 2020 23:34:39 +0200 Subject: send config-reload-command --- mumctl/src/main.rs | 4 ++++ mumd/src/state.rs | 4 ++++ mumlib/src/command.rs | 1 + 3 files changed, 9 insertions(+) diff --git a/mumctl/src/main.rs b/mumctl/src/main.rs index 44c5d26..e55796b 100644 --- a/mumctl/src/main.rs +++ b/mumctl/src/main.rs @@ -78,6 +78,8 @@ fn main() { SubCommand::with_name("config") .arg(Arg::with_name("name").required(true)) .arg(Arg::with_name("value").required(true))) + .subcommand( + SubCommand::with_name("config-reload")) .subcommand(SubCommand::with_name("completions") .arg(Arg::with_name("zsh") .long("zsh")) @@ -256,6 +258,8 @@ fn main() { println!("{} Unknown config value {}", "error:".red(), name); } } + } else if matches.subcommand_matches("config-reload").is_some() { + send_command(Command::ConfigReload).unwrap(); } else if let Some(matches) = matches.subcommand_matches("completions") { app.gen_completions_to( "mumctl", diff --git a/mumd/src/state.rs b/mumd/src/state.rs index e436d3d..08724dd 100644 --- a/mumd/src/state.rs +++ b/mumd/src/state.rs @@ -171,6 +171,10 @@ impl State { self.audio.set_input_volume(volume); (false, Ok(None)) } + Command::ConfigReload => { + self.reload_config(); + (false, Ok(None)) + } } } diff --git a/mumlib/src/command.rs b/mumlib/src/command.rs index b4ab07a..05702f0 100644 --- a/mumlib/src/command.rs +++ b/mumlib/src/command.rs @@ -8,6 +8,7 @@ pub enum Command { channel_identifier: String, }, ChannelList, + ConfigReload, InputVolumeSet(f32), ServerConnect { host: String, -- cgit v1.2.1