refactor(issue,pr): trim help, restating comments and single-use helpers

Cut issue, pr, label, milestone and comment examples to at most three, drop
doc comments that only restate the name, fold the comment and attachment
argument lookups into one closure each, and inline label helpers with one
caller.

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-12 20:48:00 +02:00
1 parent 4a85bb3d40
commit 2826726557
13 files changed
+57 -147

No files matched your search

+1 -7
View File
@@ -23,8 +23,6 @@ one select the pull request of the current branch.`}
group.Annotations = pullArgumentsAnnotation(nil)
group.Example = `$ tea pr list --author @me
$ tea pr create --fill
$ tea pr checkout 13
$ tea pr review --approve
$ tea pr merge --squash --delete-branch`
group.AddCommand(a.pullChecksCommand(), a.pullCheckoutCommand(), a.pullCleanCommand(), a.statusCommand(true))
group.AddCommand(a.pullListCommand(), a.pullViewCommand())
@@ -88,9 +86,8 @@ each pull request, which tea only makes when --json names them.`, Args: argsExac
if localFlagsChanged(cmd, "state", "limit", "page", "sort") {
empty = "no " + noun + " match your filters in " + t.Repo
}
columns := []terminal.Column{{Header: "ID", Prefix: "#"}, {Header: "Title", Flex: true}, {Header: "Branch", Flex: true, Min: 12}, {Header: "State", PipedOnly: state == "open"}, {Header: "Author"}, {Header: "Created"}}
return writeTable(a, cmd, items, listSpec[services.Pull]{
Columns: columns,
Columns: []terminal.Column{{Header: "ID", Prefix: "#"}, {Header: "Title", Flex: true}, {Header: "Branch", Flex: true, Min: 12}, {Header: "State", PipedOnly: state == "open"}, {Header: "Author"}, {Header: "Created"}},
Row: func(item services.Pull) []terminal.Cell {
state := pullState(item)
return []terminal.Cell{
@@ -125,8 +122,6 @@ each pull request, which tea only makes when --json names them.`, Args: argsExac
_ = cmd.RegisterFlagCompletionFunc("milestone", a.completeMilestones())
cmd.Example = `$ tea pr list
$ tea pr list --author @me --state all
$ tea pr list -l bug -B main --draft
$ tea pr list --state merged -L 10
$ tea pr list --json number,title,head --jq '.[] | select(.head == "feature/login")'`
return cmd
}
@@ -180,7 +175,6 @@ $ tea pr view
# View #13 with its comments and reviews
$ tea pr view 13 --comments
$ tea pr view https://gitea.com/owner/repo/pulls/13 --web
$ tea pr view feature/login --json number,state,review_decision`
return cmd
}