@@ -20,25 +20,22 @@ import (
2020)
2121
2222type Options struct {
23- DisplayProgress bool `usage:"-"`
24- DumpState string `usage:"Dump the internal execution state to a file"`
25- DebugMessages bool `usage:"Enable logging of chat completion calls"`
23+ DumpState string `usage:"Dump the internal execution state to a file"`
24+ DebugMessages bool `usage:"Enable logging of chat completion calls"`
2625}
2726
2827func Complete (opts ... Options ) (result Options ) {
2928 for _ , opt := range opts {
3029 result .DumpState = types .FirstSet (opt .DumpState , result .DumpState )
31- result .DisplayProgress = types .FirstSet (opt .DisplayProgress , result .DisplayProgress )
3230 result .DebugMessages = types .FirstSet (opt .DebugMessages , result .DebugMessages )
3331 }
3432 return
3533}
3634
3735type Console struct {
38- dumpState string
39- displayProgress bool
40- printMessages bool
41- callLock sync.Mutex
36+ dumpState string
37+ printMessages bool
38+ callLock sync.Mutex
4239}
4340
4441var (
4744
4845func (c * Console ) Start (_ context.Context , prg * types.Program , _ []string , input string ) (runner.Monitor , error ) {
4946 id := counter .Next ()
50- mon := newDisplay (c .dumpState , c .displayProgress , c . printMessages )
47+ mon := newDisplay (c .dumpState , c .printMessages )
5148 mon .callLock = & c .callLock
5249 mon .dump .ID = fmt .Sprint (id )
5350 mon .dump .Program = prg
@@ -315,23 +312,20 @@ func (d *display) Stop(output string, err error) {
315312func NewConsole (opts ... Options ) * Console {
316313 opt := Complete (opts ... )
317314 return & Console {
318- dumpState : opt .DumpState ,
319- displayProgress : opt .DisplayProgress ,
320- printMessages : opt .DebugMessages ,
315+ dumpState : opt .DumpState ,
316+ printMessages : opt .DebugMessages ,
321317 }
322318}
323319
324- func newDisplay (dumpState string , progress , printMessages bool ) * display {
320+ func newDisplay (dumpState string , printMessages bool ) * display {
325321 display := & display {
326322 dumpState : dumpState ,
327323 callIDMap : make (map [string ]string ),
328324 printMessages : printMessages ,
329325 }
330- if progress {
331- display .livePrinter = & livePrinter {
332- lastContent : map [string ]string {},
333- callIDMap : display .callIDMap ,
334- }
326+ display .livePrinter = & livePrinter {
327+ lastContent : map [string ]string {},
328+ callIDMap : display .callIDMap ,
335329 }
336330 return display
337331}
0 commit comments