From 0a1b2206390d48093f98b2a962ec975face91115 Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Mon, 30 Aug 2021 15:57:41 +0530 Subject: [PATCH] Use `-` for stdin --- rich/json.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rich/json.py b/rich/json.py index 93666d4f..c51514f4 100644 --- a/rich/json.py +++ b/rich/json.py @@ -54,7 +54,6 @@ if __name__ == "__main__": "path", metavar="PATH", help="path to file, or - for stdin", - nargs="?", ) parser.add_argument( "-i", @@ -72,7 +71,7 @@ if __name__ == "__main__": error_console = Console(stderr=True) try: - if args.path is None: + if args.path == "-": json_data = sys.stdin.read() else: with open(args.path, "rt") as json_file: