1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-02 09:21:40 +02:00

fallback to value if name not given

This commit is contained in:
Jesse Duffield 2020-09-27 09:11:19 +10:00
parent e7210dd249
commit 5724fa534a

View File

@ -121,7 +121,12 @@ func (gui *Gui) handleCustomCommandKeybinding(customCommand CustomCommand) func(
for i, option := range prompt.Options {
option := option
name, err := gui.resolveTemplate(option.Name, promptResponses)
nameTemplate := option.Name
if nameTemplate == "" {
// this allows you to only pass values rather than bother with names/descriptions
nameTemplate = option.Value
}
name, err := gui.resolveTemplate(nameTemplate, promptResponses)
if err != nil {
return gui.surfaceError(err)
}