mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-11 01:28:19 +03:00
Wire up completion for rc command options
This commit is contained in:
parent
3a8bab90dc
commit
3bf20594b7
@ -53,6 +53,8 @@ def generate_completion_for_rc(name: str) -> None:
|
||||
print(f'{name}.Description = "{serialize_as_go_string(cmd.short_desc)}"')
|
||||
for x in cmd.args.as_go_completion_code(name):
|
||||
print(x)
|
||||
for opt in rc_command_options(name):
|
||||
print(opt.as_completion_option(name))
|
||||
|
||||
|
||||
def generate_completions_for_kitty() -> None:
|
||||
|
@ -71,6 +71,7 @@ def completion(self: TestCompletion, tdir: str):
|
||||
env = os.environ.copy()
|
||||
env['PATH'] = os.path.join(tdir, 'bin')
|
||||
env['HOME'] = os.path.join(tdir, 'sub')
|
||||
env['KITTY_CONFIG_DIRECTORY'] = os.path.join(tdir, 'sub')
|
||||
cp = subprocess.run(
|
||||
[kitty_tool(), '__complete__', 'json'],
|
||||
check=True, stdout=subprocess.PIPE, cwd=tdir, input=json.dumps(all_argv).encode(), env=env
|
||||
@ -124,6 +125,11 @@ def completion(self: TestCompletion, tdir: str):
|
||||
add('kitty -1d', all_words('-1d'))
|
||||
add('kitty --directory=', all_words('--directory=bin/', '--directory=sub/'))
|
||||
add('kitty --start-as=m', all_words('--start-as=minimized', '--start-as=maximized'))
|
||||
add('kitty @launch --ty', has_words('--type'))
|
||||
add('kitty @launch --type ', has_words('window', 'background', 'overlay'))
|
||||
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'))
|
||||
|
||||
for cmd, tests, result in zip(all_cmds, all_tests, run_tool()):
|
||||
self.current_cmd = cmd
|
||||
|
Loading…
Reference in New Issue
Block a user