diff options
-rwxr-xr-x | cmd2/cmd2.py | 4 | ||||
-rw-r--r-- | tests/test_shlexparsing.py | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 4e2c053f..a124c690 100755 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -2348,10 +2348,10 @@ class Cmd(cmd.Cmd): def default(self, statement): """Executed when the command given isn't a recognized command implemented by a do_* method. - :param statement: ParsedString - subclass of string including the pyparsing ParseResults + :param statement: Statement object with parsed input :return: """ - arg = statement.full_parsed_statement() + arg = statement.raw if self.default_to_shell: result = os.system(arg) # If os.system() succeeded, then don't print warning about unknown command diff --git a/tests/test_shlexparsing.py b/tests/test_shlexparsing.py index fd010384..02dc51d3 100644 --- a/tests/test_shlexparsing.py +++ b/tests/test_shlexparsing.py @@ -19,6 +19,9 @@ Notes: Functions in cmd2.py to be modified: - _complete_statement() +Changelog Items: +- if self.default_to_shell is true, then redirection and piping is now properly passed to the shell, previously it was truncated +- object passed to do_* methods has changed. It no longer is the pyparsing object, it's a new Statement object. A side effect of this is that we now have a clean interface between the parsing logic and the rest of cmd2. If we need to change the parser in the future, we can do it without breaking anything. """ import cmd2 |