summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2017-02-03 20:33:36 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2017-02-03 20:33:36 -0500
commit3a643d42a77f31be4cd3edd9cab7c69ea079b28e (patch)
treea45b60580e29cb35b3eb1937b19b35b81a19f19b /cmd2.py
parent42c07c06ab572ed6a071bbb542b7c2a660b67710 (diff)
downloadcmd2-git-3a643d42a77f31be4cd3edd9cab7c69ea079b28e.tar.gz
Removed some unused code.
Removed some unused code I recently added for a feature which was half-implemented and probably half-baked. Better to remove it now than to cause someone confusion down the road ...
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/cmd2.py b/cmd2.py
index 4ad27e3a..4d2c55fb 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -77,13 +77,6 @@ __version__ = '0.7.0'
pyparsing.ParserElement.enablePackrat()
-# If this is False (default), then non-option arguments are passed to the "do" methods using @options as one big string.
-# If this is True, then non-option arguments are passed to the "do" methods using @options as a list of strings (shlex).
-# TODO: Figure out a good way to make this configurable by the user in cmd2.Cmd __init__ or something
-# But it needs to remain False by default for reasons of backwards compatibility.
-USE_ARGUMENT_LISTS_INSTEAD_OF_STRINGS = False
-
-
class OptionParser(optparse.OptionParser):
def exit(self, status=0, msg=None):
self.values._exit = True
@@ -149,7 +142,7 @@ optparse.Values.get = _attr_get_
options_defined = [] # used to distinguish --options from SQL-style --comments
-def options(option_list, arg_desc="arg", arg_list=USE_ARGUMENT_LISTS_INSTEAD_OF_STRINGS):
+def options(option_list, arg_desc="arg"):
'''Used as a decorator and passed a list of optparse-style options,
alters a cmd2 method to populate its ``opts`` argument from its
raw text argument.
@@ -184,10 +177,8 @@ def options(option_list, arg_desc="arg", arg_list=USE_ARGUMENT_LISTS_INSTEAD_OF_
# mustn't include the command itself
# if hasattr(arg, 'parsed') and newArgList[0] == arg.parsed.command:
# newArgList = newArgList[1:]
- if arg_list:
- newArgs = newArgList
- else:
- newArgs = remaining_args(arg, newArgList)
+
+ newArgs = remaining_args(arg, newArgList)
if isinstance(arg, ParsedString):
arg = arg.with_args_replaced(newArgs)
else: