summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcmd2.py9
-rwxr-xr-x[-rw-r--r--]docs/make.bat0
2 files changed, 7 insertions, 2 deletions
diff --git a/cmd2.py b/cmd2.py
index 218f8b8..da36b55 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -1057,7 +1057,9 @@ class Cmd(cmd.Cmd):
pass
keepstate.restore()
- def do_history(self, arg):
+ @options([make_option('-s', '--script', action="store_true", help="Script format; no separation lines"),
+ ], arg_desc = '(limit on which commands to include)')
+ def do_history(self, arg, opts):
"""history [arg]: lists past commands issued
| no arg: list all
@@ -1070,7 +1072,10 @@ class Cmd(cmd.Cmd):
else:
history = self.history
for hi in history:
- self.stdout.write(hi.pr())
+ if opts.script:
+ self.poutput(hi)
+ else:
+ self.stdout.write(hi.pr())
def last_matching(self, arg):
try:
if arg:
diff --git a/docs/make.bat b/docs/make.bat
index 3e88e03..3e88e03 100644..100755
--- a/docs/make.bat
+++ b/docs/make.bat