mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-16 05:24:20 +02:00
Ensure auto-generated entries such as --help are present for completion by calling Validate()
This commit is contained in:
@@ -186,6 +186,7 @@ func completions(before_cursor, after_cursor string) (ans *cli.Completions) {
|
||||
root := cli.NewRootCommand()
|
||||
c := root.AddSubCommand(&cli.Command{Name: "kitty-tool"})
|
||||
EntryPoint(c)
|
||||
root.Validate()
|
||||
ans = root.GetCompletions(argv, nil)
|
||||
ans.CurrentWordIdx = position_of_last_arg - len(prefix)
|
||||
return
|
||||
|
||||
@@ -12,6 +12,8 @@ import (
|
||||
var _ = fmt.Print
|
||||
|
||||
func KittyToolEntryPoints(root *cli.Command) {
|
||||
root.Add(cli.OptionSpec{
|
||||
Name: "--version", Type: "bool-set", Help: "The current kitty version."})
|
||||
// @
|
||||
at.EntryPoint(root)
|
||||
// update-self
|
||||
|
||||
Reference in New Issue
Block a user