1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-09 09:22:48 +03:00

Support suggestions generated from command in custom commands

This changes the interface a bit but it was only added earlier today so I doubt anybody is dependent on it yet.

I'm also updating the docs.
This commit is contained in:
Jesse Duffield
2023-05-29 22:46:18 +10:00
parent 29c738a88b
commit 036a1ea519
7 changed files with 338 additions and 100 deletions

View File

@@ -358,16 +358,14 @@ type CustomCommand struct {
}
type CustomCommandPrompt struct {
Key string `yaml:"key"`
// one of 'input', 'menu', 'confirm', or 'menuFromCommand'
Type string `yaml:"type"`
Type string `yaml:"type"`
Key string `yaml:"key"`
Title string `yaml:"title"`
// this only apply to input prompts
InitialValue string `yaml:"initialValue"`
SuggestionsPreset string `yaml:"suggestionsPreset"`
// these only apply to input prompts
InitialValue string `yaml:"initialValue"`
Suggestions CustomCommandSuggestions `yaml:"suggestions"`
// this only applies to confirm prompts
Body string `yaml:"body"`
@@ -382,6 +380,11 @@ type CustomCommandPrompt struct {
LabelFormat string `yaml:"labelFormat"`
}
type CustomCommandSuggestions struct {
Preset string `yaml:"preset"`
Command string `yaml:"command"`
}
type CustomCommandMenuOption struct {
Name string `yaml:"name"`
Description string `yaml:"description"`