webmetro/src/main.rs

38 lines
858 B
Rust
Raw Normal View History

2022-05-23 00:37:03 +00:00
#[macro_use]
extern crate log;
2018-04-11 05:39:28 +00:00
mod commands;
2022-05-23 00:37:03 +00:00
use clap::{Parser, Subcommand};
2022-05-23 00:37:03 +00:00
/// Utilities for broadcasting & relaying live WebM video/audio streams
#[derive(Parser, Debug)]
#[clap(version)]
struct Args {
#[clap(subcommand)]
command: Command,
}
2022-05-23 00:37:03 +00:00
#[derive(Subcommand, Debug)]
enum Command {
Dump(commands::dump::DumpArgs),
Filter(commands::filter::FilterArgs),
Relay(commands::relay::RelayArgs),
Send(commands::send::SendArgs),
2018-04-11 05:50:18 +00:00
}
fn main() {
2019-11-19 07:01:08 +00:00
env_logger::init();
2022-05-23 00:37:03 +00:00
let args = Args::parse();
2022-05-23 00:37:03 +00:00
match args.command {
Command::Dump(args) => commands::dump::run(args),
Command::Filter(args) => commands::filter::run(args),
Command::Relay(args) => commands::relay::run(args),
Command::Send(args) => commands::send::run(args),
}
.unwrap_or_else(|err| {
error!("{}", err);
});
}