| 1 | package cliscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/ |
| 2 | |
| 3 | import ( |
| 4 | "fmtscip-go gomod github.com/golang/go/src go1.25 fmt/" |
| 5 | "slicesscip-go gomod github.com/golang/go/src go1.25 slices/" |
| 6 | "stringsscip-go gomod github.com/golang/go/src go1.25 strings/" |
| 7 | |
| 8 | teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/ "github.com/charmbracelet/bubbleteascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/" |
| 9 | "github.com/charmbracelet/lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/" |
| 10 | "github.com/tomwright/dasel/v3/internalscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal`/" |
| 11 | "github.com/tomwright/dasel/v3/parsingscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/" |
| 12 | ) |
| 13 | |
| 14 | var ( |
| 15 | interactiveKeyQuitscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveKeyQuit. = teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.KeyCtrlCscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/KeyCtrlC. |
| 16 | interactiveKeyCycleReadscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveKeyCycleRead. = teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.KeyCtrlEscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/KeyCtrlE. |
| 17 | interactiveKeyCycleWritescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveKeyCycleWrite. = teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.KeyCtrlDscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/KeyCtrlD. |
| 18 | |
| 19 | headingStylescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/headingStyle. = func() lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/.Stylescip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style# { |
| 20 | return lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/.NewStylescip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/NewStyle().().Paddingscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style#Padding().(0, 1, 1, 1) |
| 21 | }() |
| 22 | shortcutStylescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/shortcutStyle. = func() lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/.Stylescip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style# { |
| 23 | return lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/.NewStylescip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/NewStyle().().Paddingscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style#Padding().(0, 1).Alignscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style#Align().(lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/.Leftscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Left.) |
| 24 | }() |
| 25 | headerStylescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/headerStyle. = func() lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/.Stylescip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style# { |
| 26 | return lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/.NewStylescip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/NewStyle().().Paddingscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style#Padding().(1).Alignscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style#Align().(lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/.Centerscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Center.) |
| 27 | }() |
| 28 | inputStylescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/inputStyle. = func() lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/.Stylescip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style# { |
| 29 | return lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/.NewStylescip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/NewStyle().().Marginscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style#Margin().(0, 0, 1, 0) |
| 30 | }() |
| 31 | outputContentStylescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/outputContentStyle. = func() lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/.Stylescip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style# { |
| 32 | return lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/.NewStylescip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/NewStyle().().Paddingscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style#Padding().(0, 1).Borderscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style#Border().(lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/.RoundedBorderscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/RoundedBorder().()) |
| 33 | }() |
| 34 | outputHeaderStylescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/outputHeaderStyle. = func() lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/.Stylescip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style# { |
| 35 | return lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/.NewStylescip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/NewStyle().().Paddingscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style#Padding().(0, 2).Marginscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style#Margin().(0, 0, 1, 0).Underlinescip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style#Underline().(true) |
| 36 | }() |
| 37 | ) |
| 38 | |
| 39 | type interactiveDaselExecutorscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveDaselExecutor# func(selector string, root bool, formatIn parsingscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/.Formatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/Format#, formatOut parsingscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/.Formatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/Format#, in string) (res string, err error) |
| 40 | |
| 41 | func newInteractiveTeaProgramscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/newInteractiveTeaProgram().(initialInput string, initialSelector string, formatIn parsingscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/.Formatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/Format#, formatOut parsingscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/.Formatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/Format#, run interactiveDaselExecutorscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveDaselExecutor#) (*teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.Programscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/Program#, func() string) { |
| 42 | m := newInteractiveRootModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/newInteractiveRootModel().(initialInput, initialSelector, formatIn, formatOut, run) |
| 43 | return teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.NewProgramscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/NewProgram().(m, teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.WithAltScreenscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/WithAltScreen().()), func() string { |
| 44 | return m.sharedDatascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#sharedData..selectorscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData#selector. |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | type interactiveSharedDatascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData# struct { |
| 49 | formatInscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData#formatIn. parsingscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/.Formatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/Format# |
| 50 | formatOutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData#formatOut. parsingscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/.Formatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/Format# |
| 51 | selectorscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData#selector. string |
| 52 | inputscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData#input. string |
| 53 | } |
| 54 | |
| 55 | type interactiveRootModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel# struct { |
| 56 | sharedDatascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#sharedData. *interactiveSharedDatascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData# |
| 57 | inputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#inputModel. *interactiveInputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel# |
| 58 | outputModelsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#outputModels. []*interactiveOutputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveOutputModel# |
| 59 | } |
| 60 | |
| 61 | func newInteractiveRootModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/newInteractiveRootModel().(initialInput string, initialSelector string, formatIn parsingscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/.Formatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/Format#, formatOut parsingscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/.Formatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/Format#, run interactiveDaselExecutorscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveDaselExecutor#) *interactiveRootModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel# { |
| 62 | res := &interactiveRootModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#{ |
| 63 | sharedDatascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#sharedData.: &interactiveSharedDatascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData#{ |
| 64 | formatInscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData#formatIn.: formatIn, |
| 65 | formatOutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData#formatOut.: formatOut, |
| 66 | selectorscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData#selector.: initialSelector, |
| 67 | inputscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData#input.: initialInput, |
| 68 | }, |
| 69 | outputModelsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#outputModels.: make([]*interactiveOutputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveOutputModel#, 0), |
| 70 | } |
| 71 | |
| 72 | res.inputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#inputModel. = newInteractiveInputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/newInteractiveInputModel().(res.sharedDatascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#sharedData.) |
| 73 | |
| 74 | outputRootModel := newInteractiveOutputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/newInteractiveOutputModel().(res.sharedDatascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#sharedData., true, run) |
| 75 | outputResultModel := newInteractiveOutputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/newInteractiveOutputModel().(res.sharedDatascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#sharedData., false, run) |
| 76 | |
| 77 | res.outputModelsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#outputModels. = append(res.outputModelsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#outputModels., outputRootModel, outputResultModel) |
| 78 | |
| 79 | return res |
| 80 | } |
| 81 | |
| 82 | func (m *interactiveRootModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#) Initscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#Init().() teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.Cmdscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/Cmd# { |
| 83 | return nil |
| 84 | } |
| 85 | |
| 86 | func cycleFormatsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/cycleFormats().(all []parsingscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/.Formatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/Format#, current parsingscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/.Formatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/Format#) parsingscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/.Formatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/Format# { |
| 87 | slicesscip-go gomod github.com/golang/go/src go1.25 slices/.SortFuncscip-go gomod github.com/golang/go/src go1.25 slices/SortFunc().(all, func(i, j parsingscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/.Formatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/Format#) int { |
| 88 | return stringsscip-go gomod github.com/golang/go/src go1.25 strings/.Comparescip-go gomod github.com/golang/go/src go1.25 strings/Compare().(string(i), string(j)) |
| 89 | }) |
| 90 | cur := -1 |
| 91 | for i, format := range all { |
| 92 | if format == current { |
| 93 | cur = i |
| 94 | break |
| 95 | } |
| 96 | } |
| 97 | next := cur + 1 |
| 98 | if next > len(all)-1 { |
| 99 | next = 0 |
| 100 | } |
| 101 | return all[next] |
| 102 | } |
| 103 | |
| 104 | func (m *interactiveRootModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#) cycleReaderscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#cycleReader().() { |
| 105 | m.sharedDatascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#sharedData..formatInscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData#formatIn. = cycleFormatsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/cycleFormats().(parsingscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/.RegisteredReadersscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/RegisteredReaders().(), m.sharedDatascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#sharedData..formatInscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData#formatIn.) |
| 106 | } |
| 107 | |
| 108 | func (m *interactiveRootModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#) cycleWriterscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#cycleWriter().() { |
| 109 | m.sharedDatascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#sharedData..formatOutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData#formatOut. = cycleFormatsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/cycleFormats().(parsingscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/.RegisteredWritersscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing`/RegisteredWriters().(), m.sharedDatascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#sharedData..formatOutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData#formatOut.) |
| 110 | } |
| 111 | |
| 112 | func (m *interactiveRootModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#) Updatescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#Update().(msg teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.Msgscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/Msg#) (teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.Modelscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/Model#, teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.Cmdscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/Cmd#) { |
| 113 | var cmds []teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.Cmdscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/Cmd# |
| 114 | var cmd teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.Cmdscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/Cmd# |
| 115 | |
| 116 | switch msg := msg.(type) { |
| 117 | case teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.KeyMsgscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/KeyMsg#: |
| 118 | switch msg.Typescip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/Key#Type. { |
| 119 | case interactiveKeyQuitscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveKeyQuit.: |
| 120 | return m, teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.Quitscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/Quit(). |
| 121 | case interactiveKeyCycleReadscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveKeyCycleRead.: |
| 122 | m.cycleReaderscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#cycleReader().() |
| 123 | case interactiveKeyCycleWritescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveKeyCycleWrite.: |
| 124 | m.cycleWriterscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#cycleWriter().() |
| 125 | default: |
| 126 | } |
| 127 | |
| 128 | case teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.WindowSizeMsgscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/WindowSizeMsg#: |
| 129 | headerStylescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/headerStyle. = headerStylescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/headerStyle..Widthscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style#Width().(msg.Widthscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/WindowSizeMsg#Width.).MaxWidthscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style#MaxWidth().(msg.Widthscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/WindowSizeMsg#Width.) |
| 130 | |
| 131 | var headerHeight int |
| 132 | { |
| 133 | headerHeight += lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/.Heightscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Height().(m.headerViewscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#headerView().()) |
| 134 | headerHeight += lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/.Heightscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Height().(m.inputViewscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#inputView().()) |
| 135 | } |
| 136 | verticalMarginHeight := headerHeight |
| 137 | |
| 138 | numCols := len(m.outputModelsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#outputModels.) |
| 139 | |
| 140 | viewportHeight := msg.Heightscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/WindowSizeMsg#Height. - verticalMarginHeight - (2 * numCols) |
| 141 | viewportWidth := (msg.Widthscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/WindowSizeMsg#Width. / numCols) - (2 * numCols) |
| 142 | |
| 143 | for _, outputModel := range m.outputModelsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#outputModels. { |
| 144 | outputModel.setSizescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveOutputModel#setSize().(viewportWidth, viewportHeight) |
| 145 | outputModel.setVerticalPositionscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveOutputModel#setVerticalPosition().(verticalMarginHeight) |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | { |
| 150 | var model teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.Modelscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/Model# |
| 151 | model, cmd = m.inputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#inputModel..Updatescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel#Update().(msg) |
| 152 | m.inputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#inputModel. = model.(*interactiveInputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel#) |
| 153 | cmds = append(cmds, cmd) |
| 154 | } |
| 155 | |
| 156 | for i, outputModel := range m.outputModelsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#outputModels. { |
| 157 | var model teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.Modelscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/Model# |
| 158 | model, cmd = outputModel.Updatescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveOutputModel#Update().(msg) |
| 159 | m.outputModelsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#outputModels.[i] = model.(*interactiveOutputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveOutputModel#) |
| 160 | cmds = append(cmds, cmd) |
| 161 | } |
| 162 | |
| 163 | return m, teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.Batchscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/Batch().(cmds...) |
| 164 | } |
| 165 | |
| 166 | func (m *interactiveRootModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#) headerViewscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#headerView().() string { |
| 167 | header := headingStylescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/headingStyle..Renderscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style#Render().("Dasel interactive mode - " + internalscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal`/.Versionscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal`/Version.) |
| 168 | |
| 169 | shortcuts := "\n" |
| 170 | shortcuts += fmtscip-go gomod github.com/golang/go/src go1.25 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.25 fmt/Sprintf().("%s: %s\n", interactiveKeyQuitscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveKeyQuit., "Quit") |
| 171 | shortcuts += fmtscip-go gomod github.com/golang/go/src go1.25 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.25 fmt/Sprintf().("%s: %s\n", interactiveKeyCycleReadscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveKeyCycleRead., "Cycle reader") |
| 172 | shortcuts += fmtscip-go gomod github.com/golang/go/src go1.25 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.25 fmt/Sprintf().("%s: %s\n", interactiveKeyCycleWritescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveKeyCycleWrite., "Cycle writer") |
| 173 | |
| 174 | out := append([]string{header}, shortcutStylescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/shortcutStyle..Renderscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style#Render().(shortcuts)) |
| 175 | |
| 176 | out = append(out, fmtscip-go gomod github.com/golang/go/src go1.25 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.25 fmt/Sprintf().("\nReader: %s | Writer: %s", m.sharedDatascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#sharedData..formatInscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData#formatIn., m.sharedDatascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#sharedData..formatOutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData#formatOut.)) |
| 177 | |
| 178 | return headerStylescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/headerStyle..Renderscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style#Render().(out...) |
| 179 | } |
| 180 | |
| 181 | func (m *interactiveRootModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#) inputViewscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#inputView().() string { |
| 182 | return inputStylescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/inputStyle..Renderscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Style#Render().(m.inputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#inputModel..Viewscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel#View().()) |
| 183 | } |
| 184 | |
| 185 | func (m *interactiveRootModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#) Viewscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#View().() string { |
| 186 | rows := make([]string, 0) |
| 187 | |
| 188 | rows = append(rows, m.headerViewscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#headerView().()) |
| 189 | |
| 190 | rows = append(rows, m.inputViewscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#inputView().()) |
| 191 | |
| 192 | { |
| 193 | cols := make([]string, 0) |
| 194 | for _, outputModel := range m.outputModelsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveRootModel#outputModels. { |
| 195 | cols = append(cols, outputModel.Viewscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveOutputModel#View().()) |
| 196 | } |
| 197 | if len(cols) > 0 { |
| 198 | rows = append(rows, lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/.JoinHorizontalscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/JoinHorizontal().(lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/.Topscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Top., cols...)) |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | return lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/.JoinVerticalscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/JoinVertical().(lipglossscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/.Leftscip-go gomod github.com/charmbracelet/lipgloss v1.1.0 `github.com/charmbracelet/lipgloss`/Left., rows...) |
| 203 | } |