Skip to content

Commit dcd9011

Browse files
committed
Fixed issue introduced in the recent batch of changes that appended to history after running a command.
This is to avoid out of order history that would result if a command made another call to onecmd().
1 parent 8ef11cd commit dcd9011

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd2/cmd2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,12 +2005,12 @@ def onecmd(self, statement: Union[Statement, str]) -> bool:
20052005
else:
20062006
func = self.cmd_func(statement.command)
20072007
if func:
2008-
stop = func(statement)
2009-
20102008
# Since we have a valid command store it in the history
20112009
if statement.command not in self.exclude_from_history:
20122010
self.history.append(statement.raw)
20132011

2012+
stop = func(statement)
2013+
20142014
else:
20152015
self.default(statement)
20162016
stop = False

0 commit comments

Comments
 (0)