mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-12 00:32:17 -04:00
core: add dynamic completion for more commands (#889)
This commit is contained in:
@@ -30,7 +30,14 @@ var keybindsShowCmd = &cobra.Command{
|
||||
Short: "Show keybinds for a provider",
|
||||
Long: "Display keybinds/cheatsheet for the specified provider",
|
||||
Args: cobra.ExactArgs(1),
|
||||
Run: runKeybindsShow,
|
||||
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
||||
if len(args) != 0 {
|
||||
return nil, cobra.ShellCompDirectiveNoFileComp
|
||||
}
|
||||
registry := keybinds.GetDefaultRegistry()
|
||||
return registry.List(), cobra.ShellCompDirectiveNoFileComp
|
||||
},
|
||||
Run: runKeybindsShow,
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
Reference in New Issue
Block a user