Fix compatibility with new cmd2

Closes-Bug: #1810213
Change-Id: I8c926152aa43359be376ec3dea83c42ecc499e80
This commit is contained in:
Felix Yan 2020-03-12 08:10:53 +08:00 committed by Monty Taylor
parent 9d20d60e89
commit b0fb8daff0
1 changed files with 12 additions and 3 deletions

View File

@ -175,9 +175,18 @@ class InteractiveApp(cmd2.Cmd):
statement.parsed.args = ' '.join(sub_argv)
else:
# cmd2 >= 0.9.1 uses shlex and gives us a Statement.
statement.command = cmd_name
statement.argv = [cmd_name] + sub_argv
statement.args = ' '.join(statement.argv)
statement = cmd2.Statement(
' '.join(sub_argv),
raw=statement.raw,
command=cmd_name,
arg_list=sub_argv,
multiline_command=statement.multiline_command,
terminator=statement.terminator,
suffix=statement.suffix,
pipe_to=statement.pipe_to,
output=statement.output,
output_to=statement.output_to,
)
return statement
def cmdloop(self):