diff --git a/Cargo.toml b/Cargo.toml index 983fd45..c971113 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,4 +5,5 @@ edition = "2021" license = "GPL-3.0-or-later" [dependencies] +clap = { version = "4.0.18", features = ["derive"] } rodio = "0.16.0" diff --git a/src/main.rs b/src/main.rs index 9dbdbc0..dd02db1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,4 @@ +use clap::Parser; fn play_file(file: &str) { use rodio::{Decoder, OutputStream, source::Source}; @@ -9,6 +10,22 @@ fn play_file(file: &str) { std::thread::sleep(std::time::Duration::from_secs(5)); } -fn main() { - play_file("test.flac"); +// https://github.com/UoC-Radio/audio-scheduler/blob/45275818423220de90b4ae578b57acdc138e5f50/main.c#L33-L63 +#[derive(Parser, Debug)] +#[command(version)] +struct Args { + #[arg(short='s', long)] + audio_sink_bin: String, + #[arg(short='d', long)] + debug_level: u8, + #[arg(short='m', long)] + debug_mask: u8, + #[arg(short='p', long)] + port: u32, + config_file: String, +} + +fn main() { + // play_file("test.flac"); + let _args = Args::parse(); }