summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
authorcatherine <catherine@dellzilla>2010-01-26 18:11:12 -0500
committercatherine <catherine@dellzilla>2010-01-26 18:11:12 -0500
commitf208c64691f67a541baf64e8b5b8c5bee8d33165 (patch)
tree00186a1aff69c70d3f75c4f2d6e8b49cebe1530e /cmd2.py
parent58620896e3f6ec4c2e0116051a81b0949b80863e (diff)
downloadcmd2-hg-f208c64691f67a541baf64e8b5b8c5bee8d33165.tar.gz
refactored, unit tests pass
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/cmd2.py b/cmd2.py
index a006637..82a7d3c 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -112,17 +112,12 @@ def options(option_list):
optionParser._func = func
def new_func(instance, arg):
try:
- if hasattr(arg, 'parsed'):
- args = arg.parsed.raw
- else:
- print 'raw arg passed to new_func!'
- args = arg
- opts, newArgList = optionParser.parse_args(args.split())
+ opts, newArgList = optionParser.parse_args(arg.split())
# Must find the remaining args in the original argument list, but
# mustn't include the command itself
- if hasattr(arg, 'parsed') and newArgList[0] == arg.parsed.command:
- newArgList = newArgList[1:]
- newArgs = remaining_args(args, newArgList)
+ #if hasattr(arg, 'parsed') and newArgList[0] == arg.parsed.command:
+ # newArgList = newArgList[1:]
+ newArgs = remaining_args(arg, newArgList)
if isinstance(arg, ParsedString):
arg = arg.with_args_replaced(newArgs)
else: