]> granicus.if.org Git - python/commitdiff
merge with 3.4
authorGeorg Brandl <georg@python.org>
Sat, 20 Sep 2014 22:38:13 +0000 (00:38 +0200)
committerGeorg Brandl <georg@python.org>
Sat, 20 Sep 2014 22:38:13 +0000 (00:38 +0200)
1  2 
Doc/distutils/builtdist.rst
Doc/library/json.rst
Doc/whatsnew/2.1.rst

Simple merge
index d6bdd8a4f89b62489e2ab1f49b0295e4fff927b5,5d97ee88fc49ceb0deee9717f8210f0c140d0dcc..55127c0a1f8b28205ab27a7e9255538dd5fb02e0
@@@ -565,54 -563,3 +565,54 @@@ the last name-value pair for a given na
     {'x': 3}
  
  The *object_pairs_hook* parameter can be used to alter this behavior.
- If the optional :option:`infile` and :option:`outfile` arguments are not
 +
 +.. highlight:: bash
 +
 +.. _json-commandline:
 +
 +Command Line Interface
 +----------------------
 +
 +The :mod:`json.tool` module provides a simple command line interface to validate
 +and pretty-print JSON objects.
 +
++If the optional ``infile`` and ``outfile`` arguments are not
 +specified, :attr:`sys.stdin` and :attr:`sys.stdout` will be used respectively::
 +
 +    $ echo '{"json": "obj"}' | python -m json.tool
 +    {
 +        "json": "obj"
 +    }
 +    $ echo '{1.2:3.4}' | python -m json.tool
 +    Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
 +
 +
 +Command line options
 +^^^^^^^^^^^^^^^^^^^^
 +
 +.. cmdoption:: infile
 +
 +   The JSON file to be validated or pretty-printed::
 +
 +      $ python -m json.tool mp_films.json
 +      [
 +          {
 +              "title": "And Now for Something Completely Different",
 +              "year": 1971
 +          },
 +          {
 +              "title": "Monty Python and the Holy Grail",
 +              "year": 1975
 +          }
 +      ]
 +
 +   If *infile* is not specified, read from :attr:`sys.stdin`.
 +
 +.. cmdoption:: outfile
 +
 +   Write the output of the *infile* to the given *outfile*. Otherwise, write it
 +   to :attr:`sys.stdout`.
 +
 +.. cmdoption:: -h, --help
 +
 +   Show the help message.
Simple merge