From 5adf7c2a3a8fcc50a19555d4d80f9dbd5e29dd31 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 27 Feb 2019 09:02:15 +0530 Subject: [PATCH] icat kitten: Add a --silent flag to avoid printing anything to stdout Useful for integration with other tools. See #1308 --- kittens/icat/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kittens/icat/main.py b/kittens/icat/main.py index c3564520f..cff2bbdb2 100755 --- a/kittens/icat/main.py +++ b/kittens/icat/main.py @@ -89,6 +89,11 @@ choices=detect,yes,no default=detect Read image data from stdin. The default is to do it automatically, when STDIN is not a terminal, but you can turn it off or on explicitly, if needed. + + +--silent +type=bool-set +Do not print out anything to stdout during operation. ''' @@ -344,7 +349,7 @@ def main(args=sys.argv): print('file' if detect_support.has_files else 'stream', end='', file=sys.stderr) return if args.transfer_mode == 'detect': - if not detect_support(wait_for=args.detection_timeout): + if not detect_support(wait_for=args.detection_timeout, silent=args.silent): raise SystemExit('This terminal emulator does not support the graphics protocol, use a terminal emulator such as kitty that does support it') else: detect_support.has_files = args.transfer_mode == 'file'