Beispiel #1
0
def complete_send_ctrl(line: str, text: str) -> List[str]:
    if len(line[:-1].split()) >= 2:
        # Control letter already given in command line
        return complete_shells(line, text, lambda i: i.enabled)
    if text in ('c', 'd', 'z'):
        return [text + ' ']
    return ['c ', 'd ', 'z ']
Beispiel #2
0
def complete_send_ctrl(line, text):
    if len(line[:-1].split()) >= 2:
        # Control letter already given in command line
        return complete_shells(line, text, lambda i: i.enabled)
    if text in ('c', 'd', 'z'):
        return [text + ' ']
    return ['c ', 'd ', 'z ']
Beispiel #3
0
def complete_set_debug(line, text):
    if len(line[:-1].split()) >= 2:
        # Debug value already given in command line
        return complete_shells(line, text)
    if text.lower() in ('y', 'n'):
        return [text + ' ']
    return ['y ', 'n ']
Beispiel #4
0
def complete_set_debug(line: str, text: str) -> List[str]:
    if len(line[:-1].split()) >= 2:
        # Debug value already given in command line
        return complete_shells(line, text)
    if text.lower() in ('y', 'n'):
        return [text + ' ']
    return ['y ', 'n ']
Beispiel #5
0
def complete_purge(line: str, text: str) -> List[str]:
    return complete_shells(line, text, lambda i: not i.enabled)
Beispiel #6
0
def complete_reconnect(line: str, text: str) -> List[str]:
    return complete_shells(line, text,
                           lambda i: i.state == remote_dispatcher.STATE_DEAD)
Beispiel #7
0
def complete_list(line, text):
    return complete_shells(line, text)
Beispiel #8
0
def complete_show_read_buffer(line, text):
    return complete_shells(
        line, text, lambda i: i.read_buffer or i.read_in_state_not_started)
Beispiel #9
0
def complete_replicate(line, text):
    if ':' not in text:
        enabled_shells = complete_shells(line, text, lambda i: i.enabled)
        return [c[:-1] + ':' for c in enabled_shells]
    shell, path = text.split(':')
    return [shell + ':' + p for p in complete_local_path(path)]
Beispiel #10
0
def complete_reconnect(line, text):
    return complete_shells(line, text, lambda i:
                                        i.state == remote_dispatcher.STATE_DEAD)
Beispiel #11
0
def complete_list(line: str, text: str) -> List[str]:
    return complete_shells(line, text)
Beispiel #12
0
def complete_disable(line, text):
    return complete_shells(line, text,
                           lambda i: i.state != remote_dispatcher.STATE_DEAD)
Beispiel #13
0
def complete_reset_prompt(line, text):
    return complete_shells(line, text, lambda i: i.enabled)
Beispiel #14
0
def complete_list(line, text):
    return complete_shells(line, text)
Beispiel #15
0
def complete_show_read_buffer(line, text):
    return complete_shells(line, text, lambda i: i.read_buffer or
                                                 i.read_in_state_not_started)
Beispiel #16
0
def complete_replicate(line, text):
    if ':' not in text:
        enabled_shells =  complete_shells(line, text, lambda i: i.enabled)
        return [c[:-1] + ':' for c in enabled_shells]
    shell, path = text.split(':')
    return [shell + ':' + p for p in complete_local_path(path)]
Beispiel #17
0
def complete_purge(line, text):
    return complete_shells(line, text, lambda i: not i.enabled)
Beispiel #18
0
def complete_reset_prompt(line: str, text: str) -> List[str]:
    return complete_shells(line, text, lambda i: i.enabled)
Beispiel #19
0
def complete_show_read_buffer(line: str, text: str) -> List[str]:
    return complete_shells(
        line, text, lambda i: i.read_buffer or i.read_in_state_not_started)
Beispiel #20
0
def complete_reset_prompt(line, text):
    return complete_shells(line, text, lambda i: i.enabled)
Beispiel #21
0
def complete_reconnect(line, text):
    return complete_shells(line, text,
                           lambda i: i.state == remote_dispatcher.STATE_DEAD)
Beispiel #22
0
def complete_disable(line, text):
    return complete_shells(line, text, lambda i:
                                        i.state != remote_dispatcher.STATE_DEAD)
Beispiel #23
0
def complete_enable(line: str, text: str) -> List[str]:
    return complete_shells(line, text,
                           lambda i: i.state != remote_dispatcher.STATE_DEAD)
Beispiel #24
0
def complete_purge(line, text):
    return complete_shells(line, text, lambda i: not i.enabled)