mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
fix(api): filter raw responses with --jq and end output with a newline
tea api /version --jq .version failed with "--jq requires --json", and --json is rejected for raw responses. api is annotated tea.rawjson now: --jq filters each successful JSON response, page by page with --paginate, and prints strings without quotes. A non-JSON response is an error with --jq; an error response prints its body unfiltered. JSON responses end with a newline, so an error no longer starts on the line of the body; on a terminal JSON is indented and colored in the key order of the response, and other text is sanitized as before. Piped non-JSON bodies stay byte-exact. api gains -i for --include and --silent, a Long help modeled on gh api (placeholders, -f/-F typing, pagination, --jq) and examples, and its help lists --jq. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
5 files changed
+209
-40
No files matched your search
@@ -420,7 +420,6 @@ const (
|
||||
pr review cancel-request
|
||||
`
|
||||
examplesToWrite = `
|
||||
api
|
||||
auth login
|
||||
auth logout
|
||||
auth refresh
|
||||
|
||||
Reference in new issue
Block a user