aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli.rs
diff options
context:
space:
mode:
authorsalmonik <raisersoft@proton.me>2026-05-09 15:14:33 +0200
committersalmonik <raisersoft@proton.me>2026-05-09 15:14:33 +0200
commitb3b7f0f65295f2100eb3c9880e870349c43701a6 (patch)
tree1b24e6eecc8d7fbe3720208fb496604fe430ab45 /src/cli.rs
parentAdd TODO for major rewrite phases (diff)
downloadrsplayer-b3b7f0f65295f2100eb3c9880e870349c43701a6.tar.gz
rsplayer-b3b7f0f65295f2100eb3c9880e870349c43701a6.zip
Major rewrite: play command, queue display, and shuffle modes
- Play command: no args queues to end (play only if queue empty + player playing), -i inserts after current and skips, -n inserts after current, removed -l flag - Queue display: detect terminal size, use pager only if queue exceeds terminal rows - Shuffle modes: always remember original queue, restore on 'shuffle none', album shuffle shuffles within each album's range separately
Diffstat (limited to '')
-rw-r--r--src/cli.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 0da3078..bd81983 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -21,15 +21,12 @@ pub enum Commands {
21 Restart, 21 Restart,
22 /// Play a track, album, or artist 22 /// Play a track, album, or artist
23 Play { 23 Play {
24 /// Play immediately (add after current and skip to it) 24 /// Add after current track and skip to it
25 #[arg(short = 'i', long = "now", group = "position")] 25 #[arg(short = 'i', long = "now")]
26 now: bool, 26 now: bool,
27 /// Add to queue after current track (don't skip) 27 /// Add to queue after current track (don't skip)
28 #[arg(short = 'n', long = "next", group = "position")] 28 #[arg(short = 'n', long = "next")]
29 next: bool, 29 next: bool,
30 /// Add to end of queue (default)
31 #[arg(short = 'l', long = "last", group = "position")]
32 last: bool,
33 #[arg(value_name = "QUERY")] 30 #[arg(value_name = "QUERY")]
34 query: Option<String>, 31 query: Option<String>,
35 }, 32 },
@@ -126,7 +123,7 @@ impl Cli {
126 }; 123 };
127 crate::daemon::send_command(format!("play {} {}", pos, q))?; 124 crate::daemon::send_command(format!("play {} {}", pos, q))?;
128 } else { 125 } else {
129 crate::daemon::send_command("play".to_string())?; 126 crate::daemon::send_command("play last".to_string())?;
130 } 127 }
131 } 128 }
132 Commands::Pause => { 129 Commands::Pause => {