From 9b43502ab70d1bd013a4cdede4805c2c0819c8c4 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Wed, 10 Oct 2018 18:08:11 -0400 Subject: Added code to handle -- in argparse completer --- cmd2/pyscript_bridge.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmd2/pyscript_bridge.py') diff --git a/cmd2/pyscript_bridge.py b/cmd2/pyscript_bridge.py index 11a2cbb3..3292976e 100644 --- a/cmd2/pyscript_bridge.py +++ b/cmd2/pyscript_bridge.py @@ -12,7 +12,7 @@ import functools import sys from typing import List, Callable, Optional -from .argparse_completer import _RangeAction, token_resembles_flag +from .argparse_completer import _RangeAction, is_potential_flag from .utils import namedtuple_with_defaults, StdSim, quote_string_if_needed # Python 3.4 require contextlib2 for temporarily redirecting stderr and stdout @@ -225,7 +225,7 @@ class ArgparseFunctor: if isinstance(value, List) or isinstance(value, tuple): for item in value: item = str(item).strip() - if token_resembles_flag(item, self._parser): + if is_potential_flag(item, self._parser): raise ValueError('{} appears to be a flag and should be supplied as a keyword argument ' 'to the function.'.format(item)) item = quote_string_if_needed(item) @@ -240,7 +240,7 @@ class ArgparseFunctor: else: value = str(value).strip() - if token_resembles_flag(value, self._parser): + if is_potential_flag(value, self._parser): raise ValueError('{} appears to be a flag and should be supplied as a keyword argument ' 'to the function.'.format(value)) value = quote_string_if_needed(value) -- cgit v1.2.1