Implement delegate based completion fof the ssh and hyperlinked_grep kittens

This commit is contained in:
Kovid Goyal
2022-09-19 13:31:32 +05:30
parent fd631bf402
commit 928a4db817
7 changed files with 33 additions and 6 deletions

View File

@@ -155,6 +155,14 @@ def get_kitten_cli_docs(kitten: str) -> Any:
return ans
def get_kitten_wrapper_of(kitten: str) -> str:
setattr(sys, 'cli_docs', {})
run_kitten(kitten, run_name='__wrapper_of__')
ans = getattr(sys, 'cli_docs')
delattr(sys, 'cli_docs')
return ans.get('wrapper_of') or ''
def get_kitten_completer(kitten: str) -> Any:
run_kitten(kitten, run_name='__completer__')
ans = getattr(sys, 'kitten_completer', None)