Update description when picking an executable
This commit is contained in:
parent
5188ff0589
commit
75eaee2adc
16
createcmd.go
16
createcmd.go
|
@ -82,16 +82,26 @@ var (
|
||||||
return executeCreate()
|
return executeCreate()
|
||||||
}
|
}
|
||||||
app := tview.NewApplication()
|
app := tview.NewApplication()
|
||||||
form := tview.NewForm().
|
form := tview.NewForm()
|
||||||
AddInputField("Description:", createOpts.Description, 40, nil, func(s string) {
|
|
||||||
|
descriptionField := tview.NewInputField().
|
||||||
|
SetLabel("Description:").
|
||||||
|
SetText(createOpts.Description).
|
||||||
|
SetFieldWidth(40).
|
||||||
|
SetAcceptanceFunc(nil).
|
||||||
|
SetChangedFunc(func(s string) {
|
||||||
createOpts.Description = s
|
createOpts.Description = s
|
||||||
}).
|
})
|
||||||
|
|
||||||
|
form.
|
||||||
AddDropDown("Type:", types, types.IndexOf(createOpts.Type), func(s string, i int) {
|
AddDropDown("Type:", types, types.IndexOf(createOpts.Type), func(s string, i int) {
|
||||||
createOpts.Type = s
|
createOpts.Type = s
|
||||||
}).
|
}).
|
||||||
AddInputField("Exec on start:", createOpts.Exec, 40, nil, func(s string) {
|
AddInputField("Exec on start:", createOpts.Exec, 40, nil, func(s string) {
|
||||||
createOpts.Exec = s
|
createOpts.Exec = s
|
||||||
|
descriptionField.SetText(fmt.Sprintf("%s service", filepath.Base(createOpts.Exec)))
|
||||||
}).
|
}).
|
||||||
|
AddFormItem(descriptionField).
|
||||||
AddInputField("Exec on stop:", createOpts.ExecStop, 40, nil, func(s string) {
|
AddInputField("Exec on stop:", createOpts.ExecStop, 40, nil, func(s string) {
|
||||||
createOpts.ExecStop = s
|
createOpts.ExecStop = s
|
||||||
}).
|
}).
|
||||||
|
|
Loading…
Reference in New Issue