MCPcopy
hub / github.com/TomWright/dasel / newInteractiveRootModel

Function newInteractiveRootModel

internal/cli/interactive_tea.go:61–80  ·  view source on GitHub ↗
(initialInput string, initialSelector string, formatIn parsing.Format, formatOut parsing.Format, run interactiveDaselExecutor)

Source from the content-addressed store, hash-verified

59}
60
61func newInteractiveRootModel(initialInput string, initialSelector string, formatIn parsing.Format, formatOut parsing.Format, run interactiveDaselExecutor) *interactiveRootModel {
62 res := &interactiveRootModel{
63 sharedData: &interactiveSharedData{
64 formatIn: formatIn,
65 formatOut: formatOut,
66 selector: initialSelector,
67 input: initialInput,
68 },
69 outputModels: make([]*interactiveOutputModel, 0),
70 }
71
72 res.inputModel = newInteractiveInputModel(res.sharedData)
73
74 outputRootModel := newInteractiveOutputModel(res.sharedData, true, run)
75 outputResultModel := newInteractiveOutputModel(res.sharedData, false, run)
76
77 res.outputModels = append(res.outputModels, outputRootModel, outputResultModel)
78
79 return res
80}
81
82func (m *interactiveRootModel) Init() tea.Cmd {
83 return nil

Callers 1

newInteractiveTeaProgramFunction · 0.85

Calls 2

newInteractiveInputModelFunction · 0.85

Tested by

no test coverage detected