From 6f7f73cdcba84e026c74f8bb74a7ae2286e55823 Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Fri, 22 Aug 2025 10:18:01 +0800 Subject: [PATCH 1/2] fix: better help messge for json.tool same as ast Signed-off-by: yihong0618 --- Lib/json/tool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/json/tool.py b/Lib/json/tool.py index 1967817add8abc..b4b03060a634b6 100644 --- a/Lib/json/tool.py +++ b/Lib/json/tool.py @@ -46,7 +46,7 @@ def main(): 'to validate and pretty-print JSON objects.') parser = argparse.ArgumentParser(description=description, color=True) parser.add_argument('infile', nargs='?', - help='a JSON file to be validated or pretty-printed', + help='a JSON file to be validated or pretty-printed, defaults to stdin', default='-') parser.add_argument('outfile', nargs='?', help='write the output of infile to outfile', From 182ac056edaa3284c15e07dde842e4fd29b24410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Fri, 22 Aug 2025 10:19:23 +0200 Subject: [PATCH 2/2] Update Lib/json/tool.py --- Lib/json/tool.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/json/tool.py b/Lib/json/tool.py index b4b03060a634b6..050c2fe2161e3e 100644 --- a/Lib/json/tool.py +++ b/Lib/json/tool.py @@ -46,7 +46,8 @@ def main(): 'to validate and pretty-print JSON objects.') parser = argparse.ArgumentParser(description=description, color=True) parser.add_argument('infile', nargs='?', - help='a JSON file to be validated or pretty-printed, defaults to stdin', + help='a JSON file to be validated or pretty-printed; ' + 'defaults to stdin', default='-') parser.add_argument('outfile', nargs='?', help='write the output of infile to outfile',