From eea640a58fa22f6156a38bda5482d28b2fff201d Mon Sep 17 00:00:00 2001 From: Vladimir Borisov Date: Wed, 17 Nov 2021 10:40:37 +0200 Subject: [PATCH] Add --staging flag; better cmd line handling --- src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 262cc92..f52cc35 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,13 +8,17 @@ use winapi::um::winuser::{ShowWindow, SW_HIDE}; mod stremio_app; use crate::stremio_app::{stremio_server::StremioServer, MainWindow}; -const WEB_ENDPOINT: &str = "http://app.strem.io/shell-v4.4/"; +const DEV_ENDPOINT: &str = "http://127.0.0.1:11470"; +const WEB_ENDPOINT: &str = "https://app.strem.io/shell-v4.4/"; +const STA_ENDPOINT: &str = "https://staging.strem.io/"; #[derive(StructOpt, Debug)] #[structopt(name = "basic")] struct Opt { #[structopt(long)] development: bool, + #[structopt(long)] + staging: bool, #[structopt(long, default_value = WEB_ENDPOINT)] webui_url: String, } @@ -46,7 +50,9 @@ fn main() { } let webui_url = if opt.development && opt.webui_url == WEB_ENDPOINT { - "http://localhost:11470".to_string() + DEV_ENDPOINT.to_string() + } else if opt.staging && opt.webui_url == WEB_ENDPOINT { + STA_ENDPOINT.to_string() } else { opt.webui_url };