diff --git a/pkg/cmd/api/api.go b/pkg/cmd/api/api.go index 7427d05b6..72e1edb19 100644 --- a/pkg/cmd/api/api.go +++ b/pkg/cmd/api/api.go @@ -41,6 +41,7 @@ type ApiOptions struct { ShowResponseHeaders bool Paginate bool Silent bool + Template string CacheTTL time.Duration HttpClient func() (*http.Client, error) @@ -95,6 +96,17 @@ func NewCmdApi(f *cmdutil.Factory, runF func(*ApiOptions) error) *cobra.Command there are no more pages of results. For GraphQL requests, this requires that the original query accepts an %[1]s$endCursor: String%[1]s variable and that it fetches the %[1]spageInfo{ hasNextPage, endCursor }%[1]s set of fields from a collection. + + With %[1]s--template%[1]s, the provided Go template is rendered using the JSON data as input. + For the syntax of Go templates, see: https://golang.org/pkg/text/template/ + + The following functions are available in templates: + - %[1]scolor