summaryrefslogtreecommitdiff
path: root/cmd2/parsing.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-12-03 13:47:27 -0500
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-12-03 13:47:27 -0500
commit4afb9e7c0c8092476ed98adccd2d389660827c25 (patch)
treec66a6a4c45cca931301c7017d9f15b0b2610c01d /cmd2/parsing.py
parentfb3486fae7df048c2ff9302ee9bf87fbe43461fb (diff)
downloadcmd2-git-4afb9e7c0c8092476ed98adccd2d389660827c25.tar.gz
First version of adding an expanded option to history items
Diffstat (limited to 'cmd2/parsing.py')
-rw-r--r--cmd2/parsing.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/cmd2/parsing.py b/cmd2/parsing.py
index d5c67ae0..f372b0d3 100644
--- a/cmd2/parsing.py
+++ b/cmd2/parsing.py
@@ -188,6 +188,26 @@ class Statement(str):
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.