Move device discovery and the display helpers out of the CLI module #17
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
wokoman/ironpod!17
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/split-cli-helpers"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Device discovery and the terminal-formatting helpers move out of the command-line module. No behaviour changes.
The seam pointed backwards. The browser imported
fit,pluralanddurationfromcli.rs, andfit's own documentation explains itself in terms of a browser pane being squeezed flat — a helper documented in terms of the caller that supposedly does not own it. Meanwhile device discovery, the one piece of real domain logic in that file, was private, so the browser could only reach it indirectly.device.rsholds mountpoint resolution and the volume scan;display.rsholds the three formatters. Their tests move with them.cli.rsgoes from 700 to 624 lines and keeps argument parsing and printing, which is what it is for.This reopens a recorded decision, which is why the ticket asked for a call before an implementation.
SPEC.mdsettled on "one file, not the module tree sketched above", on the stated premise of ~600 lines that only ever change together. That premise was about the browser module, which is now over 2,000 lines, so the finding stopped covering everything it was being cited for. It is updated rather than deleted: still one file for the browser, but a seam pointing the wrong way is not a module tree. The audio-file walker the browser also imports stays incli.rsdeliberately — #8 decides where the copy pre-flight lives, and moving it twice would be churn.65 unit tests pass,
cargo clippy --all-targetsclean.One thing to flag rather than fix: the relocated device-discovery test builds its scratch directory at a fixed path,
ironpod-detect-test, with no PID suffix, unlike every other temp-using test in the repo. One run failed immediately after the move and three runs since have passed; I could not reproduce it and am not claiming the shared path was the cause, but it is the one real hazard in that test and it is worth hardening the next time someone is in there. Left alone here because this PR is meant to relocate code, not change it.Closes #10.