def complete_cd(prefix, line, start, end, ctx): """ Completion for "cd", includes only valid directory names. """ if start != 0 and line.split(" ")[0] == "cd": return complete_dir(prefix, line, start, end, ctx, True) return set()
def complete_cd(prefix, line, start, end, ctx): """ Completion for "cd", includes only valid directory names. """ if start != 0 and line.split(' ')[0] == 'cd': return complete_dir(prefix, line, start, end, ctx, True) return set()
def venv_names_completer(command, alias: "VoxHandler", **_): envs = alias.vox.keys() from xonsh.completers.path import complete_dir yield from envs paths, _ = complete_dir(command) yield from paths
def complete_cd(command: CommandContext): """ Completion for "cd", includes only valid directory names. """ results, lprefix = complete_dir(command) if len(results) == 0: raise StopIteration return results, lprefix
def complete_rmdir(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
def complete_rmdir(prefix, line, start, end, ctx): """ Completion for "rmdir", includes only valid directory names. """ if start != 0 and line.split(" ")[0] == "rmdir": opts = {i for i in complete_from_man("-", "rmdir -", 6, 7, ctx) if i.startswith(prefix)} comps, lp = complete_dir(prefix, line, start, end, ctx, True) return comps | opts, lp return set()
def complete_cd(prefix, line, start, end, ctx): """ Completion for "cd", includes only valid directory names. """ if start != 0 and line.split(" ")[0] == "cd": results, prefix = complete_dir(prefix, line, start, end, ctx, True) if len(results) == 0: raise StopIteration return results, prefix return set()
def complete_rmdir(prefix, line, start, end, ctx): """ Completion for "rmdir", includes only valid directory names. """ if start != 0 and line.split(' ')[0] == 'rmdir': opts = {i for i in complete_from_man('-', 'rmdir -', 6, 7, ctx) if i.startswith(prefix)} comps, lp = complete_dir(prefix, line, start, end, ctx, True) return comps | opts, lp return set()
def xonsh_complete(ctx: CommandContext): """ Completion for "rmdir", includes only valid directory names. """ # if starts with the given prefix then it will get completions from man page if not ctx.prefix.startswith("-") and ctx.arg_index > 0: comps, lprefix = complete_dir(ctx) if not comps: raise StopIteration # no further file completions return comps, lprefix
def complete_rmdir(prefix, line, start, end, ctx): """ Completion for "rmdir", includes only valid directory names. """ if start != 0 and line.split(" ")[0] == "rmdir": opts = { i for i in complete_from_man("-", "rmdir -", 6, 7, ctx) if i.startswith(prefix) } comps, lp = complete_dir(prefix, line, start, end, ctx, True) if len(comps) == 0 and len(opts) == 0: raise StopIteration return comps | opts, lp return set()