diff options
author | catherine <catherine@dellzilla> | 2010-01-26 18:11:12 -0500 |
---|---|---|
committer | catherine <catherine@dellzilla> | 2010-01-26 18:11:12 -0500 |
commit | f208c64691f67a541baf64e8b5b8c5bee8d33165 (patch) | |
tree | 00186a1aff69c70d3f75c4f2d6e8b49cebe1530e /cmd2.py | |
parent | 58620896e3f6ec4c2e0116051a81b0949b80863e (diff) | |
download | cmd2-hg-f208c64691f67a541baf64e8b5b8c5bee8d33165.tar.gz |
refactored, unit tests pass
Diffstat (limited to 'cmd2.py')
-rwxr-xr-x | cmd2.py | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -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: |