mirror of
https://github.com/Stremio/stremio-shell-ng.git
synced 2026-04-21 07:41:56 +00:00
Add --staging flag; better cmd line handling
This commit is contained in:
parent
9eb6c97b4c
commit
3cedaf9afb
1 changed files with 8 additions and 2 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -8,13 +8,17 @@ use winapi::um::winuser::{ShowWindow, SW_HIDE};
|
||||||
mod stremio_app;
|
mod stremio_app;
|
||||||
use crate::stremio_app::{stremio_server::StremioServer, MainWindow};
|
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)]
|
#[derive(StructOpt, Debug)]
|
||||||
#[structopt(name = "basic")]
|
#[structopt(name = "basic")]
|
||||||
struct Opt {
|
struct Opt {
|
||||||
#[structopt(long)]
|
#[structopt(long)]
|
||||||
development: bool,
|
development: bool,
|
||||||
|
#[structopt(long)]
|
||||||
|
staging: bool,
|
||||||
#[structopt(long, default_value = WEB_ENDPOINT)]
|
#[structopt(long, default_value = WEB_ENDPOINT)]
|
||||||
webui_url: String,
|
webui_url: String,
|
||||||
}
|
}
|
||||||
|
|
@ -46,7 +50,9 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
let webui_url = if opt.development && opt.webui_url == WEB_ENDPOINT {
|
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 {
|
} else {
|
||||||
opt.webui_url
|
opt.webui_url
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue