Skip to content
Back to top
View this page
Edit this page

# xonsh.completers.commands

class xonsh.completers.commands.CommandCompleter

  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)
  property matcher

class xonsh.completers.commands.ModuleReMatcher(*names: str)

  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.

  static import_module(path, name: str)

    given the file location import as module

  get_module(module: str)
  search_completer(cmd: str, cleaned=False)
  wrap(pattern: str, module: str)

    For any commands matching the pattern complete from the `module`

  extensions = ('.py', '.xsh')

xonsh.completers.commands.complete_command(command: CommandContext)

  Returns a list of valid commands starting with the first argument

xonsh.completers.commands.complete_end_proc_keywords(command_context: CommandContext)

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

xonsh.completers.commands.complete_end_proc_tokens(command_context: CommandContext)

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

xonsh.completers.commands.complete_skipper(command_context: CommandContext)

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