@@ -47,18 +47,28 @@ func newExport(ctx context.Context) *cobra.Command {
4747 return err
4848 }
4949
50- if outOpts .Mode == options .OutputModePretty {
50+ if outOpts .Mode == options .OutputModePretty || outOpts .Mode == options .OutputModeWide {
51+ wide := outOpts .Mode == options .OutputModeWide
5152 headerFmt := color .New (color .FgGreen , color .Underline ).SprintfFunc ()
5253 columnFmt := color .New (color .FgYellow ).SprintfFunc ()
5354
54- tbl := table .New ("File Location" , "Parser" , "Subject" , "Not Before" , "Not After" , "SHA-256" )
55+ var tbl table.Table
56+ if wide {
57+ tbl = table .New ("File Location" , "Parser" , "Subject" , "Not Before" , "Not After" , "SHA-256" )
58+ } else {
59+ tbl = table .New ("File Location" , "Subject" )
60+ }
5561 tbl .WithHeaderFormatter (headerFmt ).WithFirstColumnFormatter (columnFmt )
5662
5763 for _ , cert := range parsedCertificates .Found {
58- tbl .AddRow (cert .Location , cert .Parser , cert .Certificate .Subject ,
59- cert .Certificate .NotBefore .Format (time .RFC3339 ),
60- cert .Certificate .NotAfter .Format (time .RFC3339 ),
61- hex .EncodeToString (cert .FingerprintSha256 [:]))
64+ if wide {
65+ tbl .AddRow (cert .Location , cert .Parser , cert .Certificate .Subject ,
66+ cert .Certificate .NotBefore .Format (time .RFC3339 ),
67+ cert .Certificate .NotAfter .Format (time .RFC3339 ),
68+ hex .EncodeToString (cert .FingerprintSha256 [:]))
69+ } else {
70+ tbl .AddRow (cert .Location , cert .Certificate .Subject )
71+ }
6272 }
6373
6474 tbl .Print ()
0 commit comments