xonsh/xompletions/rmdir.py
Noorhteen Raja NJ 039294c362
Xompletions (#4521)
* feat: add command completers logic

* feat: implement xompleter logic

* fix: handle callable object in exception

* chore: add xompletions package to setup.py

* fix: update tests for changes to command completer logic

* docs:

* fix: qa errors

fixes #4514

* feat: add xonsh completions

* refactor: split module matcher to separate class

* feat: add django-admin completions

* fix: failing tests

* feat: add more properties to completion-context

* refactor: cleanup code

* todo item add
2022-01-10 11:21:22 -05:00

14 lines
499 B
Python

from xonsh.completers.man import complete_from_man
from xonsh.completers.path import complete_dir
from xonsh.parsers.completion_context import CompletionContext, CommandContext
def xonsh_complete(command: CommandContext):
"""
Completion for "rmdir", includes only valid directory names.
"""
opts = complete_from_man(CompletionContext(command))
comps, lp = complete_dir(command)
if len(comps) == 0 and len(opts) == 0:
raise StopIteration
return comps | opts, lp