feat(cli): add --link flag to link configs without installs (issue #29) #30
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
feat(cli): add --link flag to link configs without installs (issue #29)
Summary
This PR implements a new
--linkCLI flag that enables "link-only" operations as requested in issue #29. When used, the flag creates or updates symlinks for configuration files without running install commands, exporting/importing defaults, or persisting state changes.Key Features:
linksections from components, skippinginstallcommands--verboseand quiet (progress) execution modesFiles Changed:
cmd/dot/main.go: Added CLI flag, execution path, and state persistence guardinternal/component/component.go: AddedLinkComponentsandLinkComponentsWithProgressmethodscmd/dot/main_test.go&internal/component/component_test.go: Added test coverageREADME.md: Updated with usage examples and behavior descriptionReview & Testing Checklist for Human
dot --link,dot --link [profile], anddot --link [fuzzy]to verify basic functionality works as expected~/.dot/state.jsonor persist profile changes (key behavioral difference)--dry-run,--verbose, and doesn't conflict with existing operationsRecommended Test Plan:
installandlinksections plus a postlink hookdot --link [component]and verify only linking occurs (no installs, no state changes)neovimto ensure expected output:✔︎ *.cli.neovim linkedDiagram
%%{ init : { "theme" : "default" }}%% graph TD CLI["cmd/dot/main.go<br/>CLI Entry Point"]:::major-edit ComponentMgr["internal/component/component.go<br/>Component Manager"]:::major-edit CLITest["cmd/dot/main_test.go<br/>CLI Flag Tests"]:::minor-edit ComponentTest["internal/component/component_test.go<br/>Link Component Tests"]:::minor-edit README["README.md<br/>Documentation"]:::minor-edit LinkMgr["internal/link/link.go<br/>Link Manager"]:::context StateMgr["internal/state/state.go<br/>State Manager"]:::context ExecMgr["internal/exec/exec.go<br/>Exec Manager"]:::context CLI --> ComponentMgr ComponentMgr --> LinkMgr ComponentMgr --> StateMgr ComponentMgr --> ExecMgr CLI -.-> CLITest ComponentMgr -.-> ComponentTest subgraph Legend L1[Major Edit]:::major-edit L2[Minor Edit]:::minor-edit L3[Context/No Edit]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes