use clap::{Parser, ValueEnum}; mod advertise; mod discover; #[derive(Parser, Debug)] #[command(version, about, long_about = None)] struct Args { #[arg(value_enum)] profile: Profiles, } #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, ValueEnum)] enum Profiles { Advertise, Discover, } // The service type we are looking for. const SERVICE_TYPE: &str = "_harmony._tcp.local."; #[tokio::main] async fn main() { env_logger::init(); let args = Args::parse(); match args.profile { Profiles::Advertise => advertise::advertise().await, Profiles::Discover => discover::discover().await, } }