Closed aramprice closed 4 months ago
The conditional here for the Completion UI should be pushed down into factory.New()
factory.New()
main.go:22
func main() { logger := newLogger() defer handlePanic() ui := boshui.NewConfUI(logger) defer ui.Flush() if completion.IsItCompletionCommand(os.Args[1:]) { // completion support blindUi := boshui.NewWrappingConfUI(&completion.BlindUI{}, logger) // only completion can write to stdout bc := completion.NewBoshComplete(blindUi, logger) err := bc.Execute(os.Args[1:]) if err != nil { fail(err, ui, logger) } } else { cmdFactory := boshcmd.NewFactory(boshcmd.NewBasicDeps(ui, logger)) cmd, err := cmdFactory.New(os.Args[1:]) if err != nil { fail(err, ui, logger) } err = cmd.Execute() if err != nil { fail(err, ui, logger) } else { success(ui, logger) } } }
The conditional here for the Completion UI should be pushed down into
factory.New()
main.go:22