summaryrefslogtreecommitdiffstats
path: root/pkg/config
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-05-29 22:46:18 +1000
committerJesse Duffield <jessedduffield@gmail.com>2023-05-29 22:47:35 +1000
commit036a1ea519885ae9962c0ba2d90f642874cabd89 (patch)
tree9c8849aa2e172a3be2d35eb016248035ff80ecf1 /pkg/config
parent29c738a88b992bf1ddeb16864767a433e3c464e3 (diff)
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.
Diffstat (limited to 'pkg/config')
-rw-r--r--pkg/config/user_config.go17
1 files changed, 10 insertions, 7 deletions
diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go
index 27ae17953..9f46948b5 100644
--- a/pkg/config/user_config.go
+++ b/pkg/config/user_config.go
@@ -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"`