diff --git a/jedi/__main__.py b/jedi/__main__.py index f2ee0477..c1e58a62 100644 --- a/jedi/__main__.py +++ b/jedi/__main__.py @@ -40,9 +40,23 @@ def _start_linter(): raise +def _complete(): + import jedi + import pdb + + try: + for c in jedi.Script(sys.argv[2]).complete(): + c.docstring() + c.type + except Exception: + pdb.post_mortem() + + if len(sys.argv) == 2 and sys.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(sys.argv) > 1 and sys.argv[1] == 'linter': _start_linter() +elif len(sys.argv) > 1 and sys.argv[1] == '_complete': + _complete()