aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 12bc3b0..79c31a8 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -68,6 +68,13 @@ pub enum Commands {
68 Queue, 68 Queue,
69 /// Show player status 69 /// Show player status
70 Status, 70 Status,
71 /// Seek within the current track
72 Seek {
73 /// Position: `90`, `1:30`, `1:02:03`, or a relative offset `+15` / `-30`;
74 /// without one, the current position is printed
75 #[arg(value_name = "POSITION", allow_hyphen_values = true)]
76 position: Option<String>,
77 },
71 /// Scan music paths to populate database 78 /// Scan music paths to populate database
72 Scan { 79 Scan {
73 #[arg(long)] 80 #[arg(long)]
@@ -198,6 +205,10 @@ impl Cli {
198 Commands::Status => { 205 Commands::Status => {
199 crate::daemon::send_command("status".to_string())?; 206 crate::daemon::send_command("status".to_string())?;
200 } 207 }
208 Commands::Seek { position } => match position {
209 Some(p) => crate::daemon::send_command(format!("seek {}", p))?,
210 None => crate::daemon::send_command("seek".to_string())?,
211 },
201 Commands::Scan { force, paths } => { 212 Commands::Scan { force, paths } => {
202 let config = Config::load()?; 213 let config = Config::load()?;
203 let db = Database::open(&config)?; 214 let db = Database::open(&config)?;