from sys import argv
from os.path import join, dirname, abspath, isdir


if len(argv) == 2 and argv[1] == 'repl':
    # don't want to use __main__ only for repl yet, maybe we want to use it for
    # something else. So just use the keyword ``repl`` for now.
    print(join(dirname(abspath(__file__)), 'api', 'replstartup.py'))
elif len(argv) > 1 and argv[1] == 'force':
    import jedi
    import sys

    if '--debug' in sys.argv:
        jedi.set_debug_function()

    path = sys.argv[2]
    if isdir(path):
        import fnmatch
        import os

        paths = []
        for root, dirnames, filenames in os.walk(path):
            for filename in fnmatch.filter(filenames, '*.py'):
                paths.append(os.path.join(root, filename))
    else:
        paths = [path]
    for path in paths:
        for error in jedi.Script(path=path)._analysis():
            print(error)

@@ -775,16 +775,30 @@
  %5Bpath%5D%0A
+%0A    try:%0A    
     for 
@@ -812,16 +812,20 @@
  paths:%0A
+    
         
@@ -881,24 +881,28 @@
             
+    
 print(error)
@@ -902,8 +902,115 @@
 (error)%0A
+    except Exception:%0A        if '--pdb' in sys.argv:%0A            import pdb%0A            pdb.post_mortem()%0A

make it possible to access pdb with 'python -m jedi force --pdb'