Example #1
0
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)])
Example #2
0
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)])
Example #3
0
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)])
Example #4
0
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)])
Example #5
0
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)])
Example #6
0
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)]
        )
Example #7
0
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)])
Example #8
0
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)])
Example #9
0
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)])
Example #10
0
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)])
Example #11
0
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)])
Example #12
0
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)])