summaryrefslogtreecommitdiff
path: root/cmd2/argcomplete_bridge.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-09-21 14:41:28 -0400
committerGitHub <noreply@github.com>2018-09-21 14:41:28 -0400
commit02a319fb88dc873b8325d207213c6ef5e27779a6 (patch)
treec544b6f531feef4c983e861ad5ef5d79ce980d01 /cmd2/argcomplete_bridge.py
parent69b16f1631c0f808964d797d84a943c862284ab5 (diff)
parentdbe485957b421f6fd973b3a493de7b264b363d54 (diff)
downloadcmd2-git-02a319fb88dc873b8325d207213c6ef5e27779a6.tar.gz
Merge branch 'master' into colorize
Diffstat (limited to 'cmd2/argcomplete_bridge.py')
-rw-r--r--cmd2/argcomplete_bridge.py10
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)