@@ -125,6 +125,8 @@ const (
125
125
// AutoMode will choose TtyMode or PlainMode depending on if the output is
126
126
// a tty.
127
127
AutoMode DisplayMode = "auto"
128
+ // QuietMode discards all output.
129
+ QuietMode DisplayMode = "quiet"
128
130
// TtyMode enforces the output is a tty and will otherwise cause an error if it isn't.
129
131
TtyMode DisplayMode = "tty"
130
132
// PlainMode is the human-readable plain text output. This mode is not meant to be read
@@ -152,11 +154,24 @@ func NewDisplay(out console.File, mode DisplayMode, opts ...DisplayOpt) (Display
152
154
return newPlainDisplay (out , opts ... ), nil
153
155
case RawJSONMode :
154
156
return newRawJSONDisplay (out , opts ... ), nil
157
+ case QuietMode :
158
+ return newDiscardDisplay (), nil
155
159
default :
156
160
return Display {}, errors .Errorf ("invalid progress mode %s" , mode )
157
161
}
158
162
}
159
163
164
+ type discardDisplay struct {}
165
+
166
+ func newDiscardDisplay () Display {
167
+ return Display {disp : & discardDisplay {}}
168
+ }
169
+
170
+ func (d * discardDisplay ) init (displayLimiter * rate.Limiter ) {}
171
+ func (d * discardDisplay ) update (ss * client.SolveStatus ) {}
172
+ func (d * discardDisplay ) refresh () {}
173
+ func (d * discardDisplay ) done () {}
174
+
160
175
type consoleDisplay struct {
161
176
t * trace
162
177
disp * ttyDisplay
0 commit comments