def _get_completes_subcommand(prefix): result = _get_command_list() + _get_alias_list() prefix = prefix.strip() if not prefix: return get_complete_set(result) else: return get_complete_set([x for x in result if x.startswith(prefix)])
def _get_completes_git_dashes(prefix): prefix = prefix.strip() git_dashes = _get_git_dashes() if not prefix: return get_complete_set(git_dashes) else: return get_complete_set( [x for x in git_dashes if x.startswith(prefix)])
def _get_completes_subcommand_dashes(cmd, prefix): command_dashes = _get_command_dashes() if cmd not in command_dashes or not command_dashes[cmd]: return {''} result = command_dashes[cmd] if not prefix: return get_complete_set(result) else: return get_complete_set([x for x in result if x.startswith(prefix)])
def _get_completes_git_dashes(prefix): prefix = prefix.strip() git_dashes = _get_git_dashes() if not prefix: return get_complete_set(git_dashes) else: return get_complete_set( [x for x in git_dashes if x.startswith(prefix)] )
def _get_completes_subcommand_subcommand(cmd, prefix): if cmd in ['pull', 'push', 'fetch', 'getpr']: result = _get_remote_list() elif cmd in ['checkout', 'co', 'branch', 'br', 'merge']: result = _get_branches() elif cmd not in _get_subcommand_subcommands(): return else: result = _get_subcommand_subcommands()[cmd] if not prefix: return get_complete_set(result) else: return get_complete_set([x for x in result if x.startswith(prefix)])
def _get_completes_subcommand_subcommand(cmd, prefix): if cmd in ['pull', 'push', 'fetch', 'getpr']: result = _get_remote_list() elif cmd in ['checkout', 'co', 'branch', 'br']: result = _get_branches() elif cmd not in _get_subcommand_subcommands(): return else: result = _get_subcommand_subcommands()[cmd] if not prefix: return get_complete_set(result) else: return get_complete_set([x for x in result if x.startswith(prefix)])
def _get_completes_subcommand(prefix): result = [ 'install', 'download', 'uninstall', 'freeze', 'list', 'show', 'search', 'wheel', 'hash', 'completion', 'help', ] prefix = prefix.strip() if not prefix: return get_complete_set(result) else: return get_complete_set([x for x in result if x.startswith(prefix)])
def _get_completes_subcommand(prefix): result = [ "install", "download", "uninstall", "freeze", "list", "show", "search", "wheel", "hash", "completion", "help", ] prefix = prefix.strip() if not prefix: return get_complete_set(result) else: return get_complete_set([x for x in result if x.startswith(prefix)])
def _get_completes_branches(remote, prefix): result = _get_branches() if not prefix: return get_complete_set(result) else: return get_complete_set([x for x in result if x.startswith(prefix)])