Index: testing/xvfb.py |
diff --git a/testing/xvfb.py b/testing/xvfb.py |
index a5620e7cde4072d7bd8b5f6bef54b27af767d9e1..3ca9aa8aa154902b87d410a4b93ce223015b27a8 100755 |
--- a/testing/xvfb.py |
+++ b/testing/xvfb.py |
@@ -6,6 +6,7 @@ |
"""Runs tests with Xvfb and Openbox on Linux and normally on other platforms.""" |
import os |
+import os.path |
import platform |
import signal |
import subprocess |
@@ -80,10 +81,19 @@ def run_executable(cmd, env): |
def main(): |
+ USAGE = 'Usage: xvfb.py [command args...]' |
if len(sys.argv) < 2: |
- print >> sys.stderr, ( |
- 'Usage: xvfb.py [command args...]') |
+ print >> sys.stderr, USAGE |
return 2 |
+ |
+ # If the user still thinks the first argument is the execution directory then |
+ # print a friendly error message and quit. |
+ if os.path.isdir(sys.argv[1]): |
+ print >> sys.stderr, ( |
+ 'Invalid command: \"%s\" is a directory' % sys.argv[1]) |
+ print >> sys.stderr, USAGE |
+ return 3 |
+ |
return run_executable(sys.argv[1:], os.environ.copy()) |