summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
authorkotfu <kotfu@kotfu.net>2018-04-23 22:43:41 -0600
committerkotfu <kotfu@kotfu.net>2018-04-23 22:43:41 -0600
commitc378b1da3c1533f538ae616e550dd4ffd270d85f (patch)
tree9c517629b10b40a4c7e558ee2f5bdfafb271d91b /cmd2/cmd2.py
parent4cee87baf6df2896c60d2d3a8811e9e65ed24c84 (diff)
downloadcmd2-git-c378b1da3c1533f538ae616e550dd4ffd270d85f.tar.gz
Another multiline fix
Diffstat (limited to 'cmd2/cmd2.py')
-rwxr-xr-xcmd2/cmd2.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index 4528b14e..b4c1dbf6 100755
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -2176,7 +2176,13 @@ class Cmd(cmd.Cmd):
return stop
def _complete_statement(self, line):
- """Keep accepting lines of input until the command is complete."""
+ """Keep accepting lines of input until the command is complete.
+
+ There is some pretty hacky code here to handle some quirks of
+ self.pseudo_raw_input(). It returns a literal 'eof' if the input
+ pipe runs out. We can't refactor it because we need to retain
+ backwards compatibility with the standard library version of cmd.
+ """
#if not line or (not pyparsing.Or(self.commentGrammars).setParseAction(lambda x: '').transformString(line)):
# raise EmptyStatement()
# statement = self.parser_manager.parsed(line) # deleteme
@@ -2192,7 +2198,7 @@ class Cmd(cmd.Cmd):
# terminator
newline = '\n'
self.poutput(newline)
- line = '%s\n%s' % (statement.raw, newline)
+ line = '{}\n{}\n'.format(statement.raw, newline)
except KeyboardInterrupt:
self.poutput('^C')
statement = self.command_parser.parseString('')
@@ -2206,7 +2212,7 @@ class Cmd(cmd.Cmd):
# terminator
newline = '\n'
self.poutput(newline)
- line = '%s\n%s' % (statement.raw, newline)
+ line = '{}\n{}\n'.format(statement.raw, newline)
statement = self.command_parser.parseString(line)
if not statement.command: