main.py 876 B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/env python
  2. # License: GPLv3 Copyright: 2021, Kovid Goyal <kovid at kovidgoyal.net>
  3. import sys
  4. from typing import List
  5. OPTIONS = r'''
  6. --key-mode -m
  7. default=normal
  8. type=choices
  9. choices=normal,application,kitty,unchanged
  10. The keyboard mode to use when showing keys. :code:`normal` mode is with DECCKM
  11. reset and :code:`application` mode is with DECCKM set. :code:`kitty` is the full
  12. kitty extended keyboard protocol.
  13. '''.format
  14. help_text = 'Show the codes generated by the terminal for key presses in various keyboard modes'
  15. usage = ''
  16. def main(args: List[str]) -> None:
  17. raise SystemExit('This should be reun as kitten show_key')
  18. if __name__ == '__main__':
  19. main(sys.argv)
  20. elif __name__ == '__doc__':
  21. cd = sys.cli_docs # type: ignore
  22. cd['usage'] = usage
  23. cd['options'] = OPTIONS
  24. cd['help_text'] = help_text
  25. cd['short_desc'] = help_text