mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 19:11:25 +01:00
refactor(output): share the JSON, created-resource and batch tails
Mutations end with a.jsonResult or a.created instead of hand-rolled --json branches, the two identical jsonResult/writeMutationJSON helpers become one, and writeBatchJSON checks --json itself so batch commands share one tail. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
32 files changed
+87
-217
No files matched your search
@@ -42,10 +42,7 @@ func (a *application) pullReviewRequestCommand(add bool) *cobra.Command {
|
||||
names = append(names, "team "+team)
|
||||
}
|
||||
a.done(cmd, "%s %s on %s", verb, strings.Join(names, ", "), refLabel(t.Repo, item.Number, item.Title))
|
||||
if a.options.json != "" {
|
||||
return a.writeJSON(cmd, item)
|
||||
}
|
||||
return nil
|
||||
return a.jsonResult(cmd, item)
|
||||
}}
|
||||
cmd.Flags().StringSliceVarP(&input.Users, "reviewer", "r", nil, "Reviewer usernames or email addresses; @me for yourself")
|
||||
cmd.Flags().StringSliceVar(&input.Teams, "team", nil, "Teams of the repository's organization")
|
||||
|
||||
Reference in new issue
Block a user