diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-09-30 11:17:04 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-09-30 11:17:04 -0400 |
commit | 81ad085cffc8f8af7fb7884bcc5db6fcede09df6 (patch) | |
tree | a197a6c81767f10b62d6ac6acfd46e42357a8289 /cmd2/argcomplete_bridge.py | |
parent | 85a21ef39467dc24a6f6f8c4f3ac656f24d6ff90 (diff) | |
parent | 61d5703cd3586b3460669a6260cf903c9863b240 (diff) | |
download | cmd2-git-81ad085cffc8f8af7fb7884bcc5db6fcede09df6.tar.gz |
Merged master into transcript_fixes branch and resolved conflicts
Diffstat (limited to 'cmd2/argcomplete_bridge.py')
-rw-r--r-- | cmd2/argcomplete_bridge.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cmd2/argcomplete_bridge.py b/cmd2/argcomplete_bridge.py index 7bdb816f..51e856ef 100644 --- a/cmd2/argcomplete_bridge.py +++ b/cmd2/argcomplete_bridge.py @@ -23,16 +23,18 @@ else: import os import shlex import sys + from typing import List, Tuple, Union from . import constants from . import utils - def tokens_for_completion(line, endidx): + def tokens_for_completion(line: str, endidx: int) -> Union[Tuple[List[str], List[str], int, int], + Tuple[None, None, None, None]]: """ Used by tab completion functions to get all tokens through the one being completed - :param line: str - the current input line with leading whitespace removed - :param endidx: int - the ending index of the prefix text + :param line: the current input line with leading whitespace removed + :param endidx: the ending index of the prefix text :return: A 4 item tuple where the items are On Success tokens: list of unquoted tokens @@ -46,7 +48,7 @@ else: The last item in both lists is the token being tab completed On Failure - Both items are None + All 4 items are None """ unclosed_quote = '' quotes_to_try = copy.copy(constants.QUOTES) |