Add type checking for the various CLI options objects

This commit is contained in:
Kovid Goyal
2020-03-05 15:47:12 +05:30
parent 0f4e7921ee
commit f05890719d
27 changed files with 487 additions and 157 deletions

View File

@@ -7,6 +7,7 @@ from contextlib import suppress
from kitty.cli import parse_args
from kitty.constants import cache_dir
from kitty.cli_stub import AskCLIOptions
from ..tui.operations import alternate_screen, styled
from ..tui.handler import result_handler
@@ -89,7 +90,7 @@ def main(args):
from kitty.shell import init_readline
msg = 'Ask the user for input'
try:
args, items = parse_args(args[1:], option_text, '', msg, 'kitty ask')
args, items = parse_args(args[1:], option_text, '', msg, 'kitty ask', result_class=AskCLIOptions)
except SystemExit as e:
if e.code != 0:
print(e.args[0])