diff mx/commands.py @ 9667:1ef7b26e9177

mx/commands.py: warn about arguments after '-version' when launching the vm
author Gilles Duboscq <duboscq@ssw.jku.at>
date Mon, 13 May 2013 16:09:49 +0200
parents fde5ccbab3a3
children 8e33b4ebfef1
line wrap: on
line diff
--- a/mx/commands.py	Mon May 13 17:11:45 2013 +0200
+++ b/mx/commands.py	Mon May 13 16:09:49 2013 +0200
@@ -763,6 +763,12 @@
 
     exe = join(jdk, 'bin', mx.exe_suffix('java'))
     dbg = _native_dbg.split() if _native_dbg is not None else []
+    
+    if '-version' in args:
+        ignoredArgs = args[args.index('-version')+1:]
+        if  len(ignoredArgs) > 0:
+            mx.log("Warning: The following options will be ignored by the vm because they come after the '-version' argument: " + ' '.join(ignoredArgs))
+    
     return mx.run(dbg + [exe, '-' + vm] + args, nonZeroIsFatal=nonZeroIsFatal, out=out, err=err, cwd=cwd, timeout=timeout)
 
 def _find_classes_with_annotations(p, pkgRoot, annotations, includeInnerClasses=False):