Repository navigation
chore(cli): split main.go by command group - #248
Merged
Merged
Conversation
main.go held 22 of 25 Kong commands in 1277 lines. Split each command group into its own file, matching the convention config.go/tags.go/ completions.go already used. Also fold SearchCmd's output.Print call into PrintTaskList (with an empty view label), so it shares ListCmd's print-then-hint path instead of diverging from it. No logic change; output is byte-identical for every command.
ryanlewis
force-pushed
the
chore/issue-242-split-main
branch
from
September 10, 2026 13:49
b0a6af4 to
8337c74
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #242
main.go was 1277 lines holding 22 of the 25 Kong commands. Split by
command group, matching the file-per-group convention already used by
config.go, tags.go, and completions.go. Also folded the ListCmd/SearchCmd
print asymmetry into one path: SearchCmd now calls PrintTaskList with an
empty view label instead of Print, producing byte-identical output.
No behaviour change.
make test,make lint,make fmtall pass.File map (old line range in main.go -> new file)
resolveTask(1116-1178),cacheTaskUUIDs(1269-1277) ->lookup.go(shared by Show, Edit, ProjectEdit, Complete, Cancel, Open)
ListCmd,applyDateFilters,ProjectsCmd,AreasCmd,TagsCmd,ShowCmd,SearchCmd(172-369, 667-687) ->list.goAddCmd(371-403) ->add.goImportCmd,validateImportJSON,offsetToLineCol(807-857,1222-1260) ->
import.go(pairs with the existingimportcheck.go)ProjectCmd,ProjectAddCmd,ProjectEditCmd(405-517) ->project.goEditCmd,CompleteCmd,CancelCmd(519-665) ->edit.goOpenCmd(859-933) ->open.goSkillCmdsubtree,resolveSkillDir(695-805, 1262-1267) ->skill.goconfirmProjectStatusChange,confirmAction(1186-1215) ->confirm.go(joins the existing
ConfirmFlags)main(),CLI,Deps,VersionCmd,LogCmd, and the kong/jsonplumbing stay in
main.go, now 350 lines.run_test.godrives commands through Kong rather than the binary, sonone of the moves touch it.