mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01: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
@@ -196,7 +196,7 @@ $ tea branch create bisect --source 3f2a9c1`,
|
||||
} else {
|
||||
a.done(cmd, "Created branch %s from %s in %s at %s", item.Name, source, target.Repo, shortSHA(item.SHA))
|
||||
}
|
||||
return a.writeMutationJSON(cmd, item)
|
||||
return a.jsonResult(cmd, item)
|
||||
},
|
||||
}
|
||||
command.Flags().StringVarP(&source, "source", "s", "", "Branch, tag or commit to start from (default: the default branch)")
|
||||
|
||||
Reference in new issue
Block a user