Summary
main.rs is currently ~1500 lines (after TUI removal in PR #86), still above the 500-line guideline. It mixes several concerns:
- CLI parsing and Args struct
- OutputSink trait and implementations (LoggingOutputSink)
- OUTPUT_SINK global state
- Interactive REPL logic
Proposed Split
| New Module |
Contents |
Why |
src/cli.rs |
CLI parsing, Args struct |
Separate concern |
src/repl.rs |
Interactive REPL logic, builtin commands |
Separate concern |
OutputSink to logging.rs: Move OutputSink trait, LoggingOutputSink, and OUTPUT_SINK global to logging.rs. This is the right home because:
- OutputSink controls where
log_event() output goes
logging.rs already has log_event() and related functions
- Keeps all logging infrastructure together
Current State
After PR #86 (TUI removal):
- No more TuiSink, TuiEventHandler
- OutputSink implementations: just
LoggingOutputSink
- main.rs is cleaner but still too large
Effort
Medium - requires careful extraction to avoid circular dependencies.
Related
Summary
main.rsis currently ~1500 lines (after TUI removal in PR #86), still above the 500-line guideline. It mixes several concerns:Proposed Split
src/cli.rssrc/repl.rsOutputSink to logging.rs: Move
OutputSinktrait,LoggingOutputSink, andOUTPUT_SINKglobal tologging.rs. This is the right home because:log_event()output goeslogging.rsalready haslog_event()and related functionsCurrent State
After PR #86 (TUI removal):
LoggingOutputSinkEffort
Medium - requires careful extraction to avoid circular dependencies.
Related