From 4afb9e7c0c8092476ed98adccd2d389660827c25 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Mon, 3 Dec 2018 13:47:27 -0500 Subject: First version of adding an expanded option to history items --- cmd2/parsing.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'cmd2/parsing.py') diff --git a/cmd2/parsing.py b/cmd2/parsing.py index d5c67ae0..f372b0d3 100644 --- a/cmd2/parsing.py +++ b/cmd2/parsing.py @@ -187,6 +187,26 @@ class Statement(str): rtn = '' return rtn + @property + def expanded_command_line(self) -> str: + """Contains command_and_args plus any ending terminator, suffix, and redirection chars""" + rtn = self.command_and_args + if self.terminator: + rtn += self.terminator + + if self.suffix: + rtn += ' ' + self.suffix + + if self.pipe_to: + rtn += ' | ' + self.pipe_to + + if self.output: + rtn += ' ' + self.output + if self.output_to: + rtn += ' ' + self.output_to + + return rtn + @property def argv(self) -> List[str]: """a list of arguments a la sys.argv. -- cgit v1.2.1