feat(cli): full command-line interface via clap

Replace the ad-hoc `--serve` arg sniff with a clap-parsed CLI:

- positional <file> to open at startup (also the OS file-association path)
- --new, --read-only, --backend, --safe-mode/--no-gpu
- --serve/--port (headless JSON automation, unchanged behaviour)
- --export IN OUT (headless format convert via the automation load/save infra)
- --script FILE (run command lines at startup)
- --log/RUST_LOG, plus --version/--help for free

GUI-only options pass to app::boot through a OnceLock config; read-only
gates the save paths. The web build skips parsing (no args).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-20 13:59:20 +03:00
commit 79bb1d67b1
8 changed files with 399 additions and 30 deletions

View file

@ -39,6 +39,10 @@ truck-modeling = "0.6"
truck-meshalgo = { version = "0.4", default-features = false, features = ["tessellation"], optional = true }
truck-polymesh = "0.6"
rfd = "0.17"
# Command-line parsing: file arg, --serve/--export/--script and the headless flags.
clap = { version = "4", features = ["derive"] }
# Opt-in logging via --log / RUST_LOG (surfaces wgpu / iced / winit diagnostics).
env_logger = "0.11"
acadrust = "0.3.4"
printpdf = "0.9.1"
flate2 = "1"