From 9b6b92d0cec58c3054c389f73fc86b96b79c17d1 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 14 Sep 2022 20:23:40 +0200 Subject: extract lib --- client-native-rift/Cargo.toml | 7 +++++++ client-native-rift/src/main.rs | 30 +++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) (limited to 'client-native-rift') diff --git a/client-native-rift/Cargo.toml b/client-native-rift/Cargo.toml index f87cf16..1693422 100644 --- a/client-native-rift/Cargo.toml +++ b/client-native-rift/Cargo.toml @@ -5,3 +5,10 @@ edition = "2021" [dependencies] client-native-lib = { path = "../client-native-lib" } + +clap = { version = "3.2.21", features = ["derive"] } +env_logger = "0.8" +log = "0.4" + +tokio = { version = "1.21", features = ["full"] } +bytes = "1.2.1" diff --git a/client-native-rift/src/main.rs b/client-native-rift/src/main.rs index e7a11a9..e5415d9 100644 --- a/client-native-rift/src/main.rs +++ b/client-native-rift/src/main.rs @@ -1,3 +1,31 @@ +use clap::{Parser, Subcommand}; +use log::error; + fn main() { - println!("Hello, world!"); + env_logger::init_from_env("LOG"); + tokio::runtime::Builder::new_multi_thread() + .enable_all() + .build() + .unwrap() + .block_on(run()) +} + +#[derive(Parser)] +pub struct Args { + #[clap(long, default_value = "meet.metamuffin.org")] + signaling_host: String, + #[clap(short, long)] + secret: String, + #[clap(subcommand)] + action: Action, +} +#[derive(Subcommand)] +pub enum Action { + Send {}, + Receive {}, +} + +async fn run() { + tokio::signal::ctrl_c().await.unwrap(); + error!("interrupt received, exiting"); } -- cgit v1.2.3-70-g09d2