[Python-checkins] r73842 - sandbox/trunk/2to3/lib2to3/main.py

benjamin.peterson python-checkins at python.org
Sat Jul 4 16:58:46 CEST 2009


Author: benjamin.peterson
Date: Sat Jul  4 16:58:46 2009
New Revision: 73842

Log:
complain when not showing diffs or writing

Modified:
   sandbox/trunk/2to3/lib2to3/main.py

Modified: sandbox/trunk/2to3/lib2to3/main.py
==============================================================================
--- sandbox/trunk/2to3/lib2to3/main.py	(original)
+++ sandbox/trunk/2to3/lib2to3/main.py	Sat Jul  4 16:58:46 2009
@@ -64,6 +64,10 @@
                     print line
 
 
+def warn(msg):
+    print >> sys.stderr, "WARNING: %s" % (msg,)
+
+
 def main(fixer_pkg, args=None):
     """Main program.
 
@@ -100,6 +104,8 @@
     # Parse command line arguments
     refactor_stdin = False
     options, args = parser.parse_args(args)
+    if not options.write and not options.show_diffs:
+        warn("not writing files and not printing diffs; that's not very useful")
     if not options.write and options.nobackups:
         parser.error("Can't use -n without -w")
     if options.list_fixes:


More information about the Python-checkins mailing list