From c35b9c655f0da9da706d4f7194db62e5b0521fde Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Fri, 7 Aug 2026 02:14:16 -0400 Subject: Add game-url option --- 2026/src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/2026/src/main.rs b/2026/src/main.rs index 07adb93..e94cc98 100644 --- a/2026/src/main.rs +++ b/2026/src/main.rs @@ -38,10 +38,14 @@ pub async fn main() { let matches = command!() .propagate_version(true) .arg(Arg::new("no-browser").help("Don't start the user's web browser").long("no-browser").action(ArgAction::SetTrue)) + .arg(Arg::new("game-url").help("URL to prepend to game paths.").long("game-url")) .get_matches(); + let prefix = if let Some(url) = matches.get_one::("game-url") { + url.to_owned() + } else { "".to_owned() }; let games: Vec = std::fs::read_dir("games") .expect("games directory does not exist!") - .filter_map(|g| g.ok().map(|h| format!("games/{}/index.html", h.file_name().display()))) + .filter_map(|g| g.ok().map(|h| format!("{}/games/{}/index.html", prefix, h.file_name().display()))) .collect(); let app = axum::Router::new() .route("/", axum::routing::get(move || async { -- cgit v1.3.1