feat: remove play command

This commit is contained in:
Tal 2024-09-26 16:13:40 +02:00
parent 1b2466e1f8
commit 5149723b5c
2 changed files with 14 additions and 10 deletions

View File

@ -8,3 +8,6 @@ It'll do this as simply as it can: no albums, no ads, just lofi.
I really hate modern music platforms, and I wanted a small, "suckless"
app that would literally just play lofi without video so I could use it
whenever.
I also wanted it to be fairly resiliant to inconsistent networks,
so it buffers 5 whole songs at a time instead of parts of the same song.

View File

@ -10,7 +10,7 @@ mod tracks;
#[command(about)]
struct Args {
#[command(subcommand)]
command: Commands,
command: Option<Commands>,
}
#[derive(Subcommand)]
@ -24,20 +24,21 @@ enum Commands {
/// Whether to include the full HTTP URL or just the distinguishing part.
#[clap(long, short)]
include_full: bool,
},
/// Starts the player.
Play,
}
}
#[tokio::main]
async fn main() -> eyre::Result<()> {
let cli = Args::parse();
match cli.command {
Commands::Scrape {
extention,
include_full,
} => scrape::scrape(extention, include_full).await,
Commands::Play => play::play().await,
if let Some(command) = cli.command {
match command {
Commands::Scrape {
extention,
include_full,
} => scrape::scrape(extention, include_full).await
}
} else {
play::play().await
}
}