@@ -114,7 +114,13 @@ func (m cmdRootModel) View() string {
114114 str += renderTests (cmd .tests , s )
115115 if cmd .results != nil && m .finalized {
116116 // render the results
117- str += fmt .Sprintf ("\n > Command exit code: %d\n " , cmd .results .ExitCode )
117+ for _ , test := range cmd .tests {
118+ // for clarity, only show exit code if it's tested
119+ if strings .Contains (test .text , "exit code" ) {
120+ str += fmt .Sprintf ("\n > Command exit code: %d\n " , cmd .results .ExitCode )
121+ break
122+ }
123+ }
118124 str += " > Command stdout:\n \n "
119125 sliced := strings .Split (cmd .results .Stdout , "\n " )
120126 for _ , s := range sliced {
@@ -138,9 +144,6 @@ func prettyPrintCmd(test api.CLICommandTestCase) string {
138144 if test .StdoutLinesGt != nil {
139145 return fmt .Sprintf ("Expect > %d lines on stdout" , * test .StdoutLinesGt )
140146 }
141- if test .StdoutMatches != nil {
142- return fmt .Sprintf ("Expect stdout to match '%s'" , * test .StdoutMatches )
143- }
144147 if test .StdoutContainsAll != nil {
145148 str := "Expect stdout to contain all of:"
146149 for _ , thing := range test .StdoutContainsAll {
0 commit comments