summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2025-01-22 09:26:41 -0500
committerLLLL Colonq <llll@colonq>2025-01-22 09:26:41 -0500
commitf448de77d84b985047a332150c0382adc1836899 (patch)
tree3003bfa2f8a74e08986ee6c0de7ad52edceb8302 /src/main.rs
Initial commit
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 0000000..92a527b
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,35 @@
+mod newton;
+
+#[cfg(not(target_arch = "wasm32"))]
+use clap::{command, Command};
+
+#[cfg(target_arch = "wasm32")]
+pub fn main() {} // dummy main, real wasm32 main is lib::main_js
+
+#[cfg(not(target_arch = "wasm32"))]
+#[tokio::main]
+pub async fn main() {
+ let matches = command!()
+ .propagate_version(true)
+ .subcommand_required(true)
+ .arg_required_else_help(true)
+ .subcommand(
+ Command::new("overlay")
+ .about("Run the LCOLONQ model renderer / overlay")
+ )
+ .subcommand(
+ Command::new("server")
+ .about("Run the LCOLONQ online websocket server")
+ )
+ .get_matches();
+ match matches.subcommand() {
+ Some(("overlay", _cm)) => {
+ teleia::run("LCOLONQ", 1920, 1080, newton::overlay::Overlay::new).await;
+ },
+ Some(("server", _cm)) => {
+ env_logger::Builder::new().filter(None, log::LevelFilter::Info).init();
+ log::info!("starting LCOLONQ server...");
+ },
+ _ => unreachable!("no subcommand"),
+ }
+}