Fix invocation of the image cat script as kitty icat

This commit is contained in:
Kovid Goyal 2017-10-05 17:19:17 +05:30
parent 664975b707
commit 49aeae4aad
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 4 deletions

View File

@ -7,7 +7,7 @@ sys.debug_gl = '--debug-kitty-gl' in sys.argv
if len(sys.argv) > 1 and sys.argv[1] == 'icat':
from kitty.icat import main
main()
main(sys.argv[1:])
else:
from kitty.main import main
main()

View File

@ -40,7 +40,7 @@ def option_parser():
a = parser.add_argument
a(
'items',
nargs=argparse.REMAINDER,
nargs='+',
help=_(
'Image files or directories. Directories are scanned recursively.'
)
@ -173,7 +173,7 @@ def scan(d):
yield os.path.join(dirpath, f), mt
def main():
def main(args=sys.argv):
signal.signal(signal.SIGWINCH, lambda: screen_size(refresh=True))
if not sys.stdout.isatty():
raise SystemExit(
@ -183,7 +183,7 @@ def main():
raise SystemExit(
'Terminal does not support reporting screen sizes via the TIOCGWINSZ ioctl'
)
args = option_parser().parse_args()
args = option_parser().parse_args(args[1:])
if not args.items:
raise SystemExit('You must specify at least one file to cat')
errors = []