This commit is contained in:
Kovid Goyal 2026-02-25 09:11:04 +05:30
parent b26d0b6ac5
commit a1927eb662
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -309,13 +309,13 @@ def main(args: list[str]) -> None:
if __name__ == '__main__':
main(sys.argv)
elif __name__ == '__doc__':
from kitty.guess_mime_type import text_mimes
cd = sys.cli_docs # type: ignore
cd['usage'] = usage
cd['options'] = OPTIONS
cd['help_text'] = help_text
cd['short_desc'] = 'Pretty, side-by-side diffing of files and images'
cd['args_completion'] = CompletionSpec.from_string(
'type:file mime:text/* mime:image/* ext:sh ext:json ext:yaml ext:toml ext:lua ext:rss ext:xml ext:xhtml'
' group:"Text and image files"')
mimes = ' '.join(f'mime:{x}' for x in ('text/*', 'image/*') + tuple(text_mimes))
cd['args_completion'] = CompletionSpec.from_string(f'type:file {mimes} group:"Text and image files"')
elif __name__ == '__conf__':
sys.options_definition = definition # type: ignore