xonsh.completers.commands

class xonsh.completers.commands.CommandCompleter[source]

Lazily complete commands from xompletions package

The base-name (case-insensitive) of the executable is used to find the matching completer module or the regex patterns.

static clean_cmd_name(cmd: str)[source]
property matcher
class xonsh.completers.commands.ModuleReMatcher(*names: str)[source]

supports regex based proxying

Helper class to search and load Python modules

Parameters:
names

extra search paths/package-names to use if finding module on namespace package fails. paths should have a path literal to indicate it is a path. Otherwise it is treated as a package name.

get_module(module: str)
static import_module(path, name: str)

given the file location import as module

search_completer(cmd: str, cleaned=False)[source]
wrap(pattern: str, module: str)[source]

For any commands matching the pattern complete from the module

extensions = ('.py', '.xsh')
xonsh.completers.commands.complete_command(command: CommandContext)[source]

Returns a list of valid commands starting with the first argument

xonsh.completers.commands.complete_end_proc_keywords(command_context: CommandContext)[source]

If there’s no space following ‘and’ or ‘or’ - insert one.

xonsh.completers.commands.complete_end_proc_tokens(command_context: CommandContext)[source]

If there’s no space following ‘|’, ‘&’, or ‘;’ - insert one.

xonsh.completers.commands.complete_skipper(command_context: CommandContext)[source]

Skip over several tokens (e.g., sudo) and complete based on the rest of the command.