Issue 21000: json.tool ought to have a help flag (original) (raw)

I current get this behavior: % python3 -m json.tool -h Traceback (most recent call last): File "/usr/lib64/python3.3/runpy.py", line 160, in _run_module_as_main "main", fname, loader, pkg_name) File "/usr/lib64/python3.3/runpy.py", line 73, in _run_code exec(code, run_globals) File "/usr/lib64/python3.3/json/tool.py", line 40, in main() File "/usr/lib64/python3.3/json/tool.py", line 21, in main infile = open(sys.argv[1], 'r') FileNotFoundError: [Errno 2] No such file or directory: '-h'

Instead of that, json.tool should show a helpful message expalining what it does in response to the -h or --help flags.