Skip to content

Commit 23f8d44

Browse files
committed
main: extract .watch switch arm to runWatch helper
From fleet code review 2026-06-01 (`disorganized`, CRITICAL). The `.watch => { ... }` block (270 lines) dispatched to the watcher subcommands (start/stop/status/list/prune/pid/restart) — a substantial chunk of fn main's remaining inline content. Extracted to `fn runWatch(allocator, settings, registry, parsed, stdout)`, preserving the inner switch on `parsed.watch_action` verbatim. Passes `parsed: cli.Parsed` directly (3 fields read). fn main now 391 lines — down from 1311 at the start of this session (70% reduction). The remaining inline arms are all <50 lines each: .config, .serve (settings shim), .symbols/.replace-symbol/.insert-*/etc. (all already call runX helpers), .status/.log/.root/.clean/.setup_model. Zero behavior change; all 51 test binaries pass.
1 parent 694c38b commit 23f8d44

1 file changed

Lines changed: 280 additions & 270 deletions

File tree

0 commit comments

Comments
 (0)