feat: add a headless mode, driven by clap CLI args

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-20 13:37:33 +02:00
co-authored by Claude Sonnet 5
parent cc0609ffbb
commit 45654c0846
8 changed files with 319 additions and 114 deletions
+15
View File
@@ -16,6 +16,8 @@ mod view;
#[cfg(not(target_arch = "wasm32"))]
mod cli;
#[cfg(not(target_arch = "wasm32"))]
mod headless;
#[cfg(not(target_arch = "wasm32"))]
mod worker;
use app::FractalApp;
@@ -49,11 +51,24 @@ fn wgpu_options() -> eframe::egui_wgpu::WgpuConfiguration {
#[cfg(not(target_arch = "wasm32"))]
fn main() -> eframe::Result {
use clap::Parser as _;
env_logger::builder()
.filter_level(log::LevelFilter::Info)
.parse_default_env()
.init();
let cli = cli::Cli::parse();
if cli.headless {
return match headless::run(cli) {
Ok(()) => Ok(()),
Err(e) => {
eprintln!("error: {e}");
std::process::exit(1);
}
};
}
let native_options = eframe::NativeOptions {
renderer: eframe::Renderer::Wgpu,
wgpu_options: wgpu_options(),