Commits

Michael Grünewald  committed 442f570

option not to pretty-print

  • Participants
  • Parent commits 5b1b56b

Comments (0)

Files changed (1)

 #!/usr/bin/env python
+from __future__ import print_function
 import argparse
 import ast
 import operator
     parser.add_argument(
         'params', metavar='parameter', nargs='*',
         help="parameter, will be interpreted as Python literal if possible")
+    parser.add_argument(
+        '-p', '--print', action='store_true',
+        help="just print, don't pretty-print")
     args = parser.parse_args()
 
     proxy = xmlrpclib.ServerProxy(args.url)
         sys.stderr.write("Exception: {:s}\n".format(exc))
         return 1
     else:
-        pprint.pprint(result)
+        if args.print:
+            print(result)
+        else:
+            pprint.pprint(result)
         return 0
 
 if __name__ == '__main__':