Add completion for kitty-tool

This commit is contained in:
Kovid Goyal 2022-09-30 11:23:58 +05:30
parent 2633356842
commit d2a2af9672
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 0 deletions

View File

@ -95,6 +95,7 @@ def generate_completions_for_kitty() -> None:
# The kitty exe
print('k := root.AddSubCommand(&cli.Command{'
'Name:"kitty", SubCommandIsOptional: true, ArgCompleter: cli.CompleteExecutableFirstArg, SubCommandMustBeFirst: true })')
print('kt := root.AddSubCommand(&cli.Command{Name:"kitty-tool", SubCommandMustBeFirst: true })')
for opt in go_options_for_seq(parse_option_spec()[0]):
print(opt.as_option('k'))
@ -121,6 +122,7 @@ def generate_completions_for_kitty() -> None:
# @
print('at.EntryPoint(k)')
print('at.EntryPoint(kt)')
# clone-in-kitty, edit-in-kitty
print('cik := root.AddSubCommand(&cli.Command{Name:"clone-in-kitty"})')

View File

@ -148,6 +148,8 @@ def completion(self: TestCompletion, tdir: str):
add('kitty @launch --cwd ', has_words('current', 'oldest', 'last_reported'))
add('kitty @launch --logo ', all_words('exe-not3.png'))
add('kitty @launch --logo ~', all_words('~/exe-not3.png'))
add('kitty-tool ', has_words('@', '@ls'))
add('kitty-tool @launch --ty', has_words('--type'))
add('kitty + ', has_words('launch', 'kitten'))
add('kitty + kitten ', has_words('icat', 'diff'))