aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/cli.rs22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/cli.rs b/src/cli.rs
index b1e6230..12bc3b0 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -64,13 +64,8 @@ pub enum Commands {
64 #[arg(value_name = "MODE")] 64 #[arg(value_name = "MODE")]
65 mode: Option<String>, 65 mode: Option<String>,
66 }, 66 },
67 /// Queue management 67 /// Show the queue
68 Queue { 68 Queue,
69 #[arg(value_name = "POSITION")]
70 position: Option<String>,
71 #[arg(value_name = "QUERY")]
72 query: Option<String>,
73 },
74 /// Show player status 69 /// Show player status
75 Status, 70 Status,
76 /// Scan music paths to populate database 71 /// Scan music paths to populate database
@@ -197,16 +192,9 @@ impl Cli {
197 crate::daemon::send_command("shuffle".to_string())?; 192 crate::daemon::send_command("shuffle".to_string())?;
198 } 193 }
199 } 194 }
200 Commands::Queue { position, query } => match (position, query) { 195 Commands::Queue => {
201 (None, None) => { 196 crate::daemon::send_command("queue".to_string())?;
202 crate::daemon::send_command("queue".to_string())?; 197 }
203 }
204 (pos, Some(q)) => {
205 let pos = pos.as_deref().unwrap_or("last");
206 crate::daemon::send_command(format!("queue {} {}", pos, q))?;
207 }
208 _ => {}
209 },
210 Commands::Status => { 198 Commands::Status => {
211 crate::daemon::send_command("status".to_string())?; 199 crate::daemon::send_command("status".to_string())?;
212 } 200 }