Exemplo n.º 1
0
def init(complete_options=False):
    """Initialize the enhanced click completion

    Parameters
    ----------
    complete_options : bool
        always complete the options, even when the user hasn't typed a first dash (Default value = False)
    """
    global _initialized
    if not _initialized:
        _patch()
        completion_configuration.complete_options = complete_options
        _initialized = True
Exemplo n.º 2
0
def init(complete_options=False, match_incomplete=None):
    """Initialize the enhanced click completion

    Parameters
    ----------
    complete_options : bool
        always complete the options, even when the user hasn't typed a first dash (Default value = False)
    match_incomplete : func
        a function with two parameters choice and incomplete. Must return True
        if incomplete is a correct match for choice, False otherwise.
    """
    global _initialized
    if not _initialized:
        _patch()
        completion_configuration.complete_options = complete_options
        if match_incomplete is not None:
            completion_configuration.match_incomplete = match_incomplete
        _initialized = True