@@ -28,6 +28,7 @@ import (
2828 "github.com/muesli/reflow/wrap"
2929 "github.com/spf13/cobra"
3030
31+ "github.com/chainloop-dev/chainloop/app/cli/cmd/output"
3132 "github.com/chainloop-dev/chainloop/app/cli/internal/action"
3233 "github.com/chainloop-dev/chainloop/pkg/attestation/renderer/chainloop"
3334)
@@ -58,12 +59,12 @@ func newAttestationStatusCmd() *cobra.Command {
5859 return err
5960 }
6061
61- output := simpleStatusTable
62+ outputF := simpleStatusTable
6263 if full {
63- output = fullStatusTable
64+ outputF = fullStatusTable
6465 }
6566
66- return encodeOutput ( res , output )
67+ return output . EncodeOutput ( flagOutputFormat , res , outputF )
6768 },
6869 }
6970
@@ -87,7 +88,7 @@ func fullStatusTableWithWriter(status *action.AttestationStatusResult, w io.Writ
8788
8889func attestationStatusTableOutput (status * action.AttestationStatusResult , w io.Writer , full bool ) error {
8990 // General info table
90- gt := newTableWriterWithWriter (w )
91+ gt := output . NewTableWriterWithWriter (w )
9192 gt .AppendRow (table.Row {"Initialized At" , status .InitializedAt .Format (time .RFC822 )})
9293 gt .AppendSeparator ()
9394 meta := status .WorkflowMeta
@@ -154,7 +155,7 @@ func envVarsTable(status *action.AttestationStatusResult, w io.Writer, full bool
154155
155156 if len (status .EnvVars ) > 0 {
156157 // Env Variables table
157- evt := newTableWriterWithWriter (w )
158+ evt := output . NewTableWriterWithWriter (w )
158159 evt .SetTitle ("Env Variables" )
159160 for k , v := range status .EnvVars {
160161 if v == "" {
@@ -167,7 +168,7 @@ func envVarsTable(status *action.AttestationStatusResult, w io.Writer, full bool
167168
168169 runnerVars := status .RunnerContext .EnvVars
169170 if len (runnerVars ) > 0 && full {
170- evt := newTableWriterWithWriter (w )
171+ evt := output . NewTableWriterWithWriter (w )
171172 evt .SetTitle ("Runner context" )
172173 for k , v := range runnerVars {
173174 if v == "" {
@@ -190,7 +191,7 @@ func materialsTable(status *action.AttestationStatusResult, w io.Writer, full bo
190191 return strings .Compare (a .Name , b .Name )
191192 })
192193
193- mt := newTableWriterWithWriter (w )
194+ mt := output . NewTableWriterWithWriter (w )
194195 mt .SetTitle ("Materials" )
195196
196197 for _ , m := range status .Materials {
0 commit comments