diff --git a/main.go b/main.go index 406eabe..aa37c62 100644 --- a/main.go +++ b/main.go @@ -17,11 +17,15 @@ const ( stateForm ) -type item string +type CommandItem struct { + ItemTitle string `json:"title"` + ItemDescription string `json:"description"` +} -func (i item) FilterValue() string { return string(i) } -func (i item) Title() string { return string(i) } -func (i item) Description() string { return "" } +func (i CommandItem) FilterValue() string { return i.ItemTitle } +func (i CommandItem) Title() string { return i.ItemTitle } +func (i CommandItem) Description() string { return i.ItemDescription } +func (i CommandItem) String() string { return i.ItemTitle } type model struct { list list.Model @@ -57,11 +61,11 @@ func (m *model) ReadForm() { func newModel() model { items := []list.Item{ - item("Run Command"), - item("Upload File"), + CommandItem{ItemTitle: "Run Command", ItemDescription: "Run a command on the remote host",}, + CommandItem{ItemTitle: "Upload File", ItemDescription: "Upload a file to the remote host",}, } l := list.New(items, list.NewDefaultDelegate(), 80, 20) - l.Title = "prddeploy" + l.Title = "Commands" return model{list: l, state: stateList} }