MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / shouldUseCustomOutputFormat

Function shouldUseCustomOutputFormat

pkg/cmd/task/wait/wait.go:311–322  ·  view source on GitHub ↗
(opts *WaitOptions, t *tasks.Task)

Source from the content-addressed store, hash-verified

309}
310
311func shouldUseCustomOutputFormat(opts *WaitOptions, t *tasks.Task) bool {
312 if opts.Command == nil {
313 return false
314 }
315
316 outputFormat, _ := opts.Command.Flags().GetString(constants.FlagOutputFormat)
317 isFormatSpecified := opts.Command.Flags().Changed(constants.FlagOutputFormat)
318 isJsonOrTable := outputFormat == constants.OutputFormatJson || outputFormat == constants.OutputFormatTable
319 isTaskReady := !opts.ShowProgress || (t.IsCompleted != nil && *t.IsCompleted)
320
321 return isFormatSpecified && isJsonOrTable && isTaskReady
322}
323
324func printTaskWithCustomFormat(opts *WaitOptions, t *tasks.Task, tableHeaderPrinted *bool) {
325 outputFormat, _ := opts.Command.Flags().GetString(constants.FlagOutputFormat)

Callers 1

WaitRunFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected