Author: Maciej Fijalkowski <[email protected]>
Branch: rpython-bytearray
Changeset: r59557:89dd5b4f1ec1
Date: 2012-12-26 12:22 +0200
http://bitbucket.org/pypy/pypy/changeset/89dd5b4f1ec1/

Log:    merge default

diff --git a/pypy/rpython/test/test_runicode.py 
b/pypy/rpython/test/test_runicode.py
--- a/pypy/rpython/test/test_runicode.py
+++ b/pypy/rpython/test/test_runicode.py
@@ -257,7 +257,7 @@
         def percentS(ch):
             x = "%s" % (ch + "bc")
             y = u"%s" % (unichr(ord(ch)) + u"bc")
-            return len(x)+len(y)
+            return len(x) + len(y)
         #
         res = self.interpret(percentS, ["a"])
         assert res == 6
@@ -266,6 +266,7 @@
         py.test.skip("not supported")
 
     test_char_isxxx = unsupported
+    test_isdigit = unsupported
     test_upper = unsupported
     test_lower = unsupported
     test_splitlines = unsupported
diff --git a/pypy/translator/goal/translate.py 
b/pypy/translator/goal/translate.py
--- a/pypy/translator/goal/translate.py
+++ b/pypy/translator/goal/translate.py
@@ -144,6 +144,8 @@
         else:
             log.ERROR("Could not find target %r" % (arg, ))
             sys.exit(1)
+    else:
+        show_help(translateconfig, opt_parser, None, config)
 
     # apply the platform settings
     set_platform(config)
@@ -163,6 +165,9 @@
                 existing_config=config,
                 translating=True)
 
+    # show the target-specific help if --help was given
+    show_help(translateconfig, opt_parser, targetspec_dic, config)
+
     # apply the optimization level settings
     set_opt_level(config, translateconfig.opt)
 
@@ -174,17 +179,26 @@
     # perform checks (if any) on the final config
     final_check_config(config)
 
+    return targetspec_dic, translateconfig, config, args
+
+def show_help(translateconfig, opt_parser, targetspec_dic, config):
     if translateconfig.help:
-        opt_parser.print_help()
-        if 'print_help' in targetspec_dic:
-            print "\n\nTarget specific help:\n\n"
+        if targetspec_dic is None:
+            opt_parser.print_help()
+            print "\n\nDefault target: %s" % translateconfig.targetspec
+            print "Run '%s --help %s' for target-specific help" % (
+                sys.argv[0], translateconfig.targetspec)
+        elif 'print_help' in targetspec_dic:
+            print "\n\nTarget specific help for %s:\n\n" % (
+                translateconfig.targetspec,)
             targetspec_dic['print_help'](config)
+        else:
+            print "\n\nNo target-specific help available for %s" % (
+                translateconfig.targetspec,)
         print "\n\nFor detailed descriptions of the command line options see"
         print "http://pypy.readthedocs.org/en/latest/config/commandline.html";
         sys.exit(0)
 
-    return targetspec_dic, translateconfig, config, args
-
 def log_options(options, header="options in effect"):
     # list options (xxx filter, filter for target)
     log('%s:' % header)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to