summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Yan <felixonmars@archlinux.org>2020-03-12 08:10:53 +0800
committerMonty Taylor <mordred@inaugust.com>2020-06-09 14:20:01 -0500
commitb0fb8daff0f4c01bdc526691e24d2cedc6e08e10 (patch)
tree289eee2db7373adf1ff0cc1ddbba5e6791fd1b0d
parent9d20d60e891f8962347da93676684c8e6d2760b8 (diff)
downloadcliff-b0fb8daff0f4c01bdc526691e24d2cedc6e08e10.tar.gz
Fix compatibility with new cmd2
Closes-Bug: #1810213 Change-Id: I8c926152aa43359be376ec3dea83c42ecc499e80
-rw-r--r--cliff/interactive.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/cliff/interactive.py b/cliff/interactive.py
index 4341d09..517061e 100644
--- a/cliff/interactive.py
+++ b/cliff/interactive.py
@@ -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):